GCC's <assert.h> and C99

Joseph S. Myers jsm28@cam.ac.uk
Sat Sep 16 02:19:00 GMT 2000

C99 requires assertion failure messages from <assert.h> to include the
name of the current function as well as the file name and line number.
GCC's <assert.h> doesn't do this.  Would it be appropriate to fix this by
adding a new __eprintf2 function that takes this information and adjusting
assert.h accordingly?  Or, it was suggested by Martin Buchholz
<martin@xemacs.org> that GCC should be using a SysV ABI function __assert
instead of __eprintf, but this function does not allow for inclusion of
the function name, so given C99 it would seem a bad idea to move to
__assert now.  Is there a corresponding replacement for __assert in the
ABI which does support C99?  If so, it would be appropriate to use that.

Joseph S. Myers

More information about the Gcc mailing list