Browse Source

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%!
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
350603cb86
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      src/include/assert.h

+ 6
- 7
src/include/assert.h View File

@@ -38,13 +38,12 @@ assert_printf ( const char *fmt, ... ) asm ( "printf" );
38 38
  * @todo Make an assertion failure abort the program
39 39
  *
40 40
  */
41
-#define assert( condition ) 						   \
42
-	do { 								   \
43
-		if ( ASSERTING && ! (condition) ) { 			   \
44
-			assert_printf ( "assert(%s) failed at %s line "	   \
45
-					"%d [%s]\n", #condition, __FILE__, \
46
-					__LINE__, __FUNCTION__ );	   \
47
-		} 							   \
41
+#define assert( condition ) 						     \
42
+	do { 								     \
43
+		if ( ASSERTING && ! (condition) ) { 			     \
44
+			assert_printf ( "assert(%s) failed at %s line %d\n", \
45
+					#condition, __FILE__, __LINE__ );    \
46
+		} 							     \
48 47
 	} while ( 0 )
49 48
 
50 49
 /**

Loading…
Cancel
Save