-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Simon Josefsson on 3/3/2008 9:07 AM: |> I like the idea. I would also like to see the assert module use it, if the |> platform's assert() lacks __func__ information as required by C99/POSIX 2001. | | How can that be implemented? The current assert module seems to only | add a --disable-assert, rather than replacing a incorrect assert | function.
Well, it would imply a gnulib replacement <assert.h>. Unfortunately, I don't see any easy way to see what underlying function assert expands to when NDEBUG is not defined, so all I can think of is adding assert.c to gnulib, declaring rpl_assert(int expr, const char *file, int line, const char *function), and doing: #ifdef NDEBUG # define assert(e) ((void) 0) #else # define assert(e) ((e) ? (void) 0 \ ~ : rpl_assert (#e, __FILE__, __LINE__, __func__)) #endif - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHzLB684KuGfSFAYARAkrxAJ9jAFnkYpxv62w7wjwLGAHt0OrBhwCgj160 NchmcLAz8jFb6yceQbUjq+E= =+4u7 -----END PGP SIGNATURE-----