Silence -Wunused-but-set-variable error with clang
[babeltrace.git] / src / common / macros.h
index ff7da410106a39d981556cd13d0905d2a2d662b8..c42cdf5a52f358d1e5c8d13a09689a99bbe8e73d 100644 (file)
                _ref;                   \
        })
 
+#if defined __clang__
+#  if __has_warning("-Wunused-but-set-variable")
+#    define BT_DIAG_IGNORE_UNUSED_BUT_SET_VARIABLE \
+       _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")
+#  endif
+#endif
+
+#if !defined BT_DIAG_IGNORE_UNUSED_BUT_SET_VARIABLE
+#  define BT_DIAG_IGNORE_UNUSED_BUT_SET_VARIABLE
+#endif
+
 #endif
This page took 0.022693 seconds and 4 git commands to generate.