[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] __STDC_VERSION__ not defined
From: |
Georg-Johann Lay |
Subject: |
Re: [avr-gcc-list] __STDC_VERSION__ not defined |
Date: |
Tue, 18 Apr 2017 10:08:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 |
On 15.04.2017 19:15, Victor Aprea wrote:
Hey all,
I'm working on porting a library and I've run across an unfortunate
surprise (or I'm just doing it wrong).
Can someone confirm that avr-gcc 4.8.1 doesn't (implicitly)
define __STDC_VERSION__ as suggested by
https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros?
It works for me, e.g.:
$ echo | avr-gcc-4.8 -std=iso9899:199409 -xc - -E -dM | grep STDC_V
#define __STDC_VERSION__ 199409L
$ echo | avr-gcc-4.8 -std=iso9899:1999 -xc - -E -dM | grep STDC_V
#define __STDC_VERSION__ 199901L
etc.
$ avr-gcc-4.8 -v
...
Target: avr
Configured with: ../../gcc.gnu.org/gcc-4_8-branch/configure --target=avr
--prefix=/local/gnu/install/gcc-4.8 --disable-nls --with-dwarf2
--enable-target-optspace=yes --with-gnu-ld --with-gnu-as
--enable-languages=c,c++
Thread model: single
gcc version 4.8.5 20150220 (prerelease) (GCC)
Johann
If not, how is a library to determine if the compiler is C89 or C99 or
whatever?
Kind Regards,
Vic