Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0
[lttng-modules.git] / lib / bitfield.h
index 2f7c01dfc8d6f61289dc96051267e658c43f1f36..a9e268b4153031d9eb10ccae39df17c5f310b7ed 100644 (file)
 /*
  * _bt_is_signed_type() willingly generates comparison of unsigned
  * expression < 0, which is always false. Silence compiler warnings.
+ * GCC versions lower than 4.6.0 do not accept diagnostic pragma inside
+ * functions.
  */
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
 # define _BT_DIAG_PUSH                 _Pragma("GCC diagnostic push")
 # define _BT_DIAG_POP                  _Pragma("GCC diagnostic pop")
 
@@ -44,6 +46,7 @@
 # define _BT_DIAG_PUSH
 # define _BT_DIAG_POP
 # define _BT_DIAG_IGNORE
+# define _BT_DIAG_IGNORE_TYPE_LIMITS
 #endif
 
 #define _bt_is_signed_type(type)       ((type) -1 < (type) 0)
This page took 0.02492 seconds and 4 git commands to generate.