summaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-12-09 11:59:26 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-12-09 11:59:49 -0500
commitd0e8026d650bb4318ea8608865d5f5a011366dcc (patch)
treeb291854144b237e5c58c7f3dffe32ceb3a71c01a /src/config.h
parent0cc598f1628167599131756e909630dc36d33610 (diff)
downloadbfs-d0e8026d650bb4318ea8608865d5f5a011366dcc.tar.xz
Turn on more aggressive format string warnings
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
index 4a49b75..229f593 100644
--- a/src/config.h
+++ b/src/config.h
@@ -198,4 +198,19 @@
# define BFS_TARGET_CLONES true
#endif
+/**
+ * Ignore a particular GCC warning for a region of code.
+ */
+#if __GNUC__
+# define BFS_PRAGMA_STRINGIFY(...) _Pragma(#__VA_ARGS__)
+# define BFS_SUPPRESS(warning) \
+ _Pragma("GCC diagnostic push"); \
+ BFS_PRAGMA_STRINGIFY(GCC diagnostic ignored warning)
+# define BFS_UNSUPPRESS() \
+ _Pragma("GCC diagnostic pop")
+#else
+# define BFS_SUPPRESS(warning)
+# define BFS_UNSUPPRESS()
+#endif
+
#endif // BFS_CONFIG_H