Libgcc symbols

Russ Allbery rra@stanford.edu
Tue Apr 17 23:14:00 GMT 2001


Russ Allbery <rra@Stanford.EDU> writes:

> Why not define assert as:

> #define assert(expr)  \
>   ((void) ((expr) ? 0 : __assert (#expr, __FILE__, __LINE__, __func__)))

> #define __assert(expression, file, line, function) \
>   ({                                                                    \
>     fprintf (stderr, "%s:%u: failed assertion `%s' in function %s\n",   \
>              expression, file, line, function);                         \
>     abort ();                                                           \
>   })

Er, with the obvious reordering of parameters to fprintf to make that
produce sensical output.  Sorry.

-- 
Russ Allbery (rra@stanford.edu)             < http://www.eyrie.org/~eagle/ >



More information about the Gcc mailing list