I've dealt with most of these already, but one is giving me a headache, so I figured I'd put it out there to see if anyone has any ideas. PUT_FREE (defined in lists.h) is a pretty clever little preprocessor macro that's used all over the place:
Code: Select all
#define PUT_FREE(item, freelist) \
do { \
if ( (item)->is_free ) { \
bug("PUT_FREE: item is ALREADY FREE! Aborting...", 0); \
abort(); \
} \
(item)->next = (freelist); \
(item)->is_free = TRUE; /* This sets is_free flag */ \
(freelist) = (item); \
if (freelist##_destructor) freelist##_destructor(item); \
} while(0)
I'm afraid that I'm looking at the rather boring task of going through every PUT_FREE reference to check, by hand, whether the function exists or not, and having two versions of the macro, one with the check and the function call, and one without.
Any suggestions?
In case it matters: compiled on xubuntu 11.10 32-bit, gcc version 4.6.1. The specific error is "warning: the address of `note_free_destructor' will always evaluate as `true' [-Waddress]" although "note_free_destructor" could be replaced with any similar destructor function. Should repro with the GCC4-cleaned *chuckle* version of 4.3.1, although if memory serves, there are a few other issues with it as well.