summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-03-21 23:30:14 +0200
committerPeter Eisentraut <peter_e@gmx.net>2012-03-21 23:33:10 +0200
commit0e85abd658738db9ea183c133c89c3c94ee37dae (patch)
tree54ef3bd66cfb7ccee3bc3f1989a21706703a48da /src/include
parent621eb156f159d4979193939902f49ea597972a7d (diff)
Clean up compiler warnings from unused variables with asserts disabled
For those variables only used when asserts are enabled, use a new macro PG_USED_FOR_ASSERTS_ONLY, which expands to __attribute__((unused)) when asserts are not enabled.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 82acd14a9b4..96375ab567c 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -710,6 +710,18 @@ typedef NameData *Name;
#define STATUS_WAITING (2)
+/*
+ * Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only
+ * used in assert-enabled builds, to avoid compiler warnings about unused
+ * variables in assert-disabled builds.
+ */
+#ifdef USE_ASSERT_CHECKING
+#define PG_USED_FOR_ASSERTS_ONLY
+#else
+#define PG_USED_FOR_ASSERTS_ONLY __attribute__((unused))
+#endif
+
+
/* gettext domain name mangling */
/*