X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fbitfield.h;h=5ed629381ac6ff9508b4e432d8d784660a776d9b;hb=3f6807bfb5f8e87d09251d3b284d9d586741186b;hp=7faf23f98f08b301a86a0f52ef226170244833c5;hpb=52594aefe69a056ab20d0c9e0b62d58f73986738;p=lttng-ust.git diff --git a/include/lttng/bitfield.h b/include/lttng/bitfield.h index 7faf23f9..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") @@ -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)