On Mon, Jun 27, 2005 at 08:29:59PM -0400, Chip Salzenberg wrote:
> On Mon, Jun 27, 2005 at 05:11:10PM -0400, Andy Dougherty wrote:
> > Well, I think there are already way too many pointer casts and related
> > games in the source. Perhaps more to the point, not all casts are going
> > to work.
>
> Well, there is that. :-)
> struct group *g = malloc(sizeof *g) /* OR WHATEVER METHOD OF ALLOC */
^typo
> Then gcc should just shut up, IMO. When I cast from void* or char* to
> whatever*, it's my lookout as programmer if that's an error, and
> there's nothing about it that deserves a compiler warning ... mostly
> because there are some things in C that require it, and the compiler
> can't possibly distinguish the good from the bogus. It's like warning
> about '=' in boolean expressions. Yeah, I know. :-P
We may well have the warning because we turned on as many bitchy flags in gcc
as possible.
Do all our casts avoid creating aliasing problems?
Nicholas Clark