Subject: Re: __UNCONST(a)
To: None <tech-userlevel@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 06/30/2004 02:47:25
>> #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
> Is this to work around gcc and/or lint being overly aggressive in
> enforcing "const"ness of a type? Or bugs in those tools?
"Overly" aggressive? I would speculate - and it is not entirely
uninformed speculation, as I have wanted something with equivalent
semantics myself often enough - that it is so that programs can get the
benefit of the strict checking of -Wcast-qual -Wwrite-strings while
still using interfaces (like writev()) that are broken with respect to
those checks.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B