[PATCH] Fixes sentinel warnings on GCC4

Karl Hegbloom hegbloom at pdx.edu
Tue Dec 6 11:33:59 EST 2005


On Mon, 2005-12-05 at 18:28 -0500, Chris Shoemaker wrote:
> The C-language rule is "always cast NULL when used as a sentinel to a
> variadic function, otherwise you're accidentally passing integer
> zero, which is wrong."

I think that's bogus.  NULL should always be a pointer (void *)0, and if
it's not, then the header that defined it is wrong.  You should not have
to cast it.

At least on my machine, it's defined in <stddef.h> as (void *)0.

  /usr/lib/gcc/i486-linux-gnu/4.0.2/include/stddef.h

I made a cscope index of /usr/include, and am finding definitions of
NULL all over the place.  Hmmm.

-- 
Karl Hegbloom <hegbloom at pdx.edu>



More information about the gnucash-devel mailing list