Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0
[lttng-ust.git] / include / lttng / bitfield.h
index 7faf23f98f08b301a86a0f52ef226170244833c5..5ed629381ac6ff9508b4e432d8d784660a776d9b 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")
 
@@ -59,6 +61,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.022822 seconds and 4 git commands to generate.