Don't include __FUNCTION__ in assert() messages; it was causing the
authorMichael Brown <mcb30@etherboot.org>
Thu, 4 Jan 2007 13:48:13 +0000 (13:48 +0000)
committerMichael Brown <mcb30@etherboot.org>
Thu, 4 Jan 2007 13:48:13 +0000 (13:48 +0000)
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

index e76ceb9..93750a1 100644 (file)
@@ -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 )
 
 /**