From: Jonathan Rajotte Date: Thu, 4 Jul 2019 18:51:37 +0000 (-0400) Subject: Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0 X-Git-Tag: v2.12.0-rc1~32 X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=3f6807bfb5f8e87d09251d3b284d9d586741186b Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0 Signed-off-by: Jonathan Rajotte Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/bitfield.h b/include/lttng/bitfield.h index 92f1c2c9..5ed62938 100644 --- a/include/lttng/bitfield.h +++ b/include/lttng/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")