Closed seanfarley closed 10 years ago
Hi. Thanks for these. I wondered if using local functions might cause a problem for someone....
However I don't want to merge them as they are. For 'free_stuff' I would prefer if the call site still looked like a function call. i.e. it should still be "free_stuff()" everywhere. Also for all of them the standard practice when creating these sorts of macro is to wrap the body in "do {" and "}while(0)", so that a ";" afterwards is syntactically part of the statement. This is import if the macro/function ever call using in a compound statement like "if (...) free_stuff(); else ....". If you could redo that patches with those two changes I'll happily pull them. Thanks, NeilBrown
Thanks for the review! I've changed the macros to use 'do … while(0)' now. Let me know if that works for you.
Yes, that works for me, thanks.
Compiling with clang (default on Mac OS X nowadays) threw a bunch of errors since nested functions are a gcc C language extension. -Wno-missing-field-initializers has also been added to the makefile since the line that clang complained about:
is valid C99 and will indeed be zeroed upon initialization.