From: Jonathan Rajotte Date: Thu, 4 Jul 2019 18:40:03 +0000 (-0400) Subject: Do not use diagnostic pragma when GCC version is lower than 4.6.0 X-Git-Tag: v1.5.8~7 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=ea4c6f4c5cabcec9dd43b14d0dddfb39f6defdae Do not use diagnostic pragma when GCC version is lower than 4.6.0 Signed-off-by: Jonathan Rajotte Change-Id: Id17713b2683ea0bbe17388282557d2a75be8f177 Signed-off-by: Jérémie Galarneau --- diff --git a/include/babeltrace/bitfield.h b/include/babeltrace/bitfield.h index e6563c37..006ec88c 100644 --- a/include/babeltrace/bitfield.h +++ b/include/babeltrace/bitfield.h @@ -44,8 +44,10 @@ /* * _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")