Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 4 Jul 2019 18:51:37 +0000 (14:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2019 18:53:59 +0000 (14:53 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/bitfield.h

index 92f1c2c988bcd0d2bfe3aa9aa137a0b5d6f8d272..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")
 
This page took 0.024756 seconds and 4 git commands to generate.