Workaround 'condition is redundant or null deref is possible' cppcheck FP
[platform/upstream/libgc.git] / cord / tests / de.c
index f69edde..9f554d1 100644 (file)
 #endif
 #include "de_cmds.h"
 
-#define OUT_OF_MEMORY do { \
+#if defined(CPPCHECK)
+# define MACRO_BLKSTMT_BEGIN {
+# define MACRO_BLKSTMT_END   }
+#else
+# define MACRO_BLKSTMT_BEGIN do {
+# define MACRO_BLKSTMT_END   } while (0)
+#endif
+
+#define OUT_OF_MEMORY MACRO_BLKSTMT_BEGIN \
                         fprintf(stderr, "Out of memory\n"); \
                         exit(3); \
-                      } while (0)
+                      MACRO_BLKSTMT_END
 
 /* List of line number to position mappings, in descending order. */
 /* There may be holes.                                            */