enclosed the assert replacement in braces. In release mode, the assert is replaced with nothing and there's a little bit of code in addObjectDialog which uses it as a statement in an one-line if(). With the assert disappearing in release builds this triggered a GCC warning, as the if would be left without a body.

Tue, 22 Oct 2013 13:47:41 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 22 Oct 2013 13:47:41 +0300
changeset 523
a12e36f2db5f
parent 522
afa691788bdb
child 524
52d5884b753c

enclosed the assert replacement in braces. In release mode, the assert is replaced with nothing and there's a little bit of code in addObjectDialog which uses it as a statement in an one-line if(). With the assert disappearing in release builds this triggered a GCC warning, as the if would be left without a body.

src/common.h file | annotate | diff | comparison | revisions
--- a/src/common.h	Tue Oct 22 13:40:16 2013 +0300
+++ b/src/common.h	Tue Oct 22 13:47:41 2013 +0300
@@ -143,9 +143,9 @@
 #endif // assert
 
 #ifdef DEBUG
-# define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N))
+# define assert(N) { ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N)) }
 #else
-# define assert(N)
+# define assert(N) {}
 #endif // DEBUG
 
 // Version string identifier

mercurial