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:40:03 +0000 (14:40 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2019 22:17:32 +0000 (17:17 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: Id17713b2683ea0bbe17388282557d2a75be8f177
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/bitfield.h

index e6563c37047d6ccf984ac737e50b5755a00b42b0..006ec88c9833d8f9e8b72933321c97028b9af744 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.024644 seconds and 4 git commands to generate.