Subject: Re: __UNCONST(a)
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 06/30/2004 21:45:53
On Jul 1, 10:22am, yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote:
-- Subject: Re: __UNCONST(a)

| > | > I would like to add:
| > | > 
| > | >     /* No intptr_t dependency here */
| > | >     #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
| > | > 
| > | > in <sys/cdefs.h>
| > | > 
| > | > Any objections?
| > | 
| > | FreeBSD has __DECONST.
| > | please follow it unless there's a compelling reason.
| > 
| > Ok, DECONST it is...
| 
| i think that it's a bad idea to follow only its name while being imcompatible.
| FreeBSD's is:
| #define	__DECONST(type, var)	((type)(uintptr_t)(const void *)(var))

Why cast to a specific type? We could do the same, but it seems gratuitous.

christos