From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Rajotte Subject: [PATCH lttng-ust 2/2] Fix: do not use diagnostic pragma when GCC version is lower than 4.6.0 Date: Thu, 4 Jul 2019 14:51:37 -0400 Message-ID: <20190704185137.24943-2-jonathan.rajotte-julien__37762.4271599174$1562266378$gmane$org@efficios.com> References: <20190704185137.24943-1-jonathan.rajotte-julien@efficios.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.efficios.com (mail.efficios.com [167.114.142.138]) by lists.lttng.org (Postfix) with ESMTPS id 45fnCF2kD0z10Xl for ; Thu, 4 Jul 2019 14:52:09 -0400 (EDT) In-Reply-To: <20190704185137.24943-1-jonathan.rajotte-julien@efficios.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org Signed-off-by: Jonathan Rajotte --- include/lttng/bitfield.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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") -- 2.17.1