about summary refs log tree commit diff homepage
path: root/include/klee/Support/CompilerWarning.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/klee/Support/CompilerWarning.h')
-rw-r--r--include/klee/Support/CompilerWarning.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/klee/Support/CompilerWarning.h b/include/klee/Support/CompilerWarning.h
new file mode 100644
index 00000000..ce192292
--- /dev/null
+++ b/include/klee/Support/CompilerWarning.h
@@ -0,0 +1,33 @@
+//===-- CompilerWarning.h ---------------------------------------*- C++ -*-===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H
+#define KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H
+
+// Disables different warnings
+#if defined(__GNUC__) || defined(__clang__)
+#define ENABLE_PRAGMA(X) _Pragma(#X)
+#define DISABLE_WARNING_PUSH ENABLE_PRAGMA(GCC diagnostic push)
+#define DISABLE_WARNING_POP ENABLE_PRAGMA(GCC diagnostic pop)
+#define DISABLE_WARNING(warningName)                                           \
+  ENABLE_PRAGMA(GCC diagnostic ignored #warningName)
+
+#define DISABLE_WARNING_DEPRECATED_DECLARATIONS                                \
+  DISABLE_WARNING(-Wdeprecated-declarations)
+
+#else
+
+#define DISABLE_WARNING_PUSH
+#define DISABLE_WARNING_POP
+#define DISABLE_WARNING(warningName)
+
+#define DISABLE_WARNING_DEPRECATED_DECLARATIONS
+#endif
+
+#endif // KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H