This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Detecting whether gcc supports complex types
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 13 Nov 2014 07:54:45 +0100
- Subject: Re: Detecting whether gcc supports complex types
- Authentication-results: sourceware.org; auth=none
- References: <20141112134151 dot GA29100 at linux dot vnet dot ibm dot com> <CAH6eHdTUm+EEFYMt73Kx07O7=7qk_bdRO2_nrTrLV4qzt442Ng at mail dot gmail dot com>
- Reply-to: vogt at linux dot vnet dot ibm dot com
On Wed, Nov 12, 2014 at 04:34:05PM +0000, Jonathan Wakely wrote:
> On 12 November 2014 13:41, Dominik Vogt wrote:
> > However, this does not work with a plain gcc call, i.e. gcc does
> > not define __STDC_VERSION__ (or __STDC__) if not told explicitly
> > which standard to use, e.g. with --std=c99.
>
> That's not quite accurate - you can tell gcc to explicitly use
> -std=c90 and it doesn't define it, or you can use current trunk with
> no -std option and it defines it (because trunk defaults to C11).
>
> GCC does not define __STDC_VERSION__ unless compiling C99 or later,
> because (I believe) that's when the macro was first defined.
>
> So it's nothing to do with an explicit -std option, it's to do with
> the language version being used, implicitly or explicitly.
Checking macros for all kinds of compilers seemed to burdensome,
so I'll use an AC_TRY_COMPILE configure check instead.
Thanks for the information.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany