From 350603cb86a408c46ba0d5c4b6be88fa550d5209 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 4 Jan 2007 13:48:13 +0000 Subject: [PATCH] Don't include __FUNCTION__ in assert() messages; it was causing the function name to appear within the objects even in non-asserting builds. (This could be considered a gcc bug.) Removing __FUNCTION__ from assert() reduces the size of bin/blib.a by around 2.5%! --- src/include/assert.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/include/assert.h b/src/include/assert.h index e76ceb979..93750a1e8 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -38,13 +38,12 @@ assert_printf ( const char *fmt, ... ) asm ( "printf" ); * @todo Make an assertion failure abort the program * */ -#define assert( condition ) \ - do { \ - if ( ASSERTING && ! (condition) ) { \ - assert_printf ( "assert(%s) failed at %s line " \ - "%d [%s]\n", #condition, __FILE__, \ - __LINE__, __FUNCTION__ ); \ - } \ +#define assert( condition ) \ + do { \ + if ( ASSERTING && ! (condition) ) { \ + assert_printf ( "assert(%s) failed at %s line %d\n", \ + #condition, __FILE__, __LINE__ ); \ + } \ } while ( 0 ) /**