[patch] More gcc 4.2.3 compilation fixes

Andreas Köhler andi5.py at gmx.net
Sun Dec 30 14:24:33 EST 2007

Hi Jerry,

Am Sonntag, den 30.12.2007, 13:36 -0500 schrieb Jerry Quinn:
> After the last fix, I ran into another set of cases of gcc being too 
> smart for its own good.  In this case, we're calling the macro 
> QOF_BOOK_LOOKUP_ENTITY, which checks its args for null pointers. 
> However, several indirect callers such as gncInvoiceLookupFlip() and its 
> siblings are passing the address of a stack variable, which can't be 
> null.  GCC then helpfully warns that this check will always be true, 
> then killing the compile.
> To fix it, I created an alternate QOF_BOOK_LOOKUP_ENTITY_NC that leaves 
> arg checking to the caller and propagated that up to the places that 
> died because of the always true warnings.
> This patch squelches the warnings but I can't help feeling like there 
> should be a cleaner way of solving the problem.
> Opinions welcome,
> Jerry Quinn


An alternative would be to disable this type of warning completely, like
in the attached patch.  Does it work for you?

-- andi5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Wno-address.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20071230/15c36076/attachment.bin 

More information about the gnucash-devel mailing list