This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fixes for a small number of compiler warnings
- From: Ed Maste <emaste at freebsd dot org>
- To: Ed Schouten <ed at nuxi dot nl>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Hans-Peter Nilsson <hp at bitrange dot com>, Binutils <binutils at sourceware dot org>
- Date: Wed, 1 Apr 2015 15:45:51 -0400
- Subject: Re: [PATCH] Fixes for a small number of compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <CABh_MKmKPHAfVo5Q2BkBnQuGFk-x+5a3j46KtXgF9_af2UHrCg at mail dot gmail dot com> <CABh_MKnE8EBOCuTCofXi2CsWsOVq5xtC+cPqZB-NgotzKFFGLg at mail dot gmail dot com> <20150401003744 dot GN26234 at bubble dot grove dot modra dot org> <alpine dot BSF dot 2 dot 02 dot 1503312120010 dot 87955 at arjuna dot pair dot com> <20150401024707 dot GP26234 at bubble dot grove dot modra dot org> <CAMe9rOrpdXYXG-Lsq3UVCnLxwTk-qFAKZE4Ms5UALquTa9cSNA at mail dot gmail dot com> <20150401032705 dot GQ26234 at bubble dot grove dot modra dot org> <CAMe9rOpi+SxEp8BTacMjuaQ_EcYusd9ks_dbHgNTfUwg0bWCDw at mail dot gmail dot com> <20150401034857 dot GR26234 at bubble dot grove dot modra dot org> <CAMe9rOrYaZpnnRM38k9tqJ_cbNK5j_3wLm+gJeQh_bY4nq2D9A at mail dot gmail dot com> <20150401053346 dot GS26234 at bubble dot grove dot modra dot org> <CAMe9rOpLsusSkfLFaKrocdAiPPXHN5J30p=zgdm3ARKp_SqSww at mail dot gmail dot com> <CABh_MKmzuXd94za=54W2RmTLse=41HBm_05MsLg3xy1b5hO3Uw at mail dot gmail dot com> <CAMe9rOqw4jdsBhF_ugftoD-oHJwE=1We1h8c7tTP-OU2DM+Knw at mail dot gmail dot com> <CABh_MKkTu_Au=_KMDcsEGsmcmQvq8ZQFEADL8XvugAK1eQseLg at mail dot gmail dot com>
On 1 April 2015 at 14:43, Ed Schouten <ed@nuxi.nl> wrote:
> 2015-04-01 17:16 GMT+02:00 H.J. Lu <hjl.tools@gmail.com>:
>> +#if defined(__GNUC__) && GCC_VERSION < 4006
>
> So the issue with this expression is that this also evaluates to true
> when using Clang. Clang also defines __GNUC__ as it implements most
> GNU-specific constructs. It has to define this to make existing code
> out there work.
>
> This makes the code work for me:
>
> #if defined(__GNUC__) && GCC_VERSION < 4006 && !defined(__clang__)
FWIW ICC also defines __GNUC__.
Clang does not define GCC_VERSION, so that might be another way to approach it.
The GCC version macros Clang defines are:
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4