]> granicus.if.org Git - postgresql/commitdiff
Define Assert() et al to ((void)0) to avoid pedantic warnings.
authorAndres Freund <andres@anarazel.de>
Mon, 8 Dec 2014 19:28:09 +0000 (20:28 +0100)
committerAndres Freund <andres@anarazel.de>
Fri, 19 Dec 2014 13:27:45 +0000 (14:27 +0100)
gcc's -Wempty-body warns about the current usage when compiling
postgres without --enable-cassert.

src/include/c.h

index ce38d78736f5ae275a9186ccaf209786c4b77bcf..93d6924c5c4eed8b59a46344d260e1350cafa016 100644 (file)
@@ -578,12 +578,12 @@ typedef NameData *Name;
  */
 #ifndef USE_ASSERT_CHECKING
 
-#define Assert(condition)
+#define Assert(condition)      ((void)true)
 #define AssertMacro(condition) ((void)true)
-#define AssertArg(condition)
-#define AssertState(condition)
+#define AssertArg(condition)   ((void)true)
+#define AssertState(condition) ((void)true)
 #define AssertPointerAlignment(ptr, bndr)      ((void)true)
-#define Trap(condition, errorType)
+#define Trap(condition, errorType)     ((void)true)
 #define TrapMacro(condition, errorType) (true)
 
 #elif defined(FRONTEND)