X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com Message-ID: <504E3764.7090100@iki.fi> Date: Mon, 10 Sep 2012 21:54:28 +0300 From: Andris Pavenis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Invalid tests for __STDC_VERSION__ in DJGPP header files References: <504CD18B DOT 1060207 AT iki DOT fi> In-Reply-To: Content-Type: multipart/mixed; boundary="------------080001030002020206080903" Reply-To: djgpp-workers AT delorie DOT com This is a multi-part message in MIME format. --------------080001030002020206080903 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 09/10/2012 12:19 AM, Rugxulo wrote: > Hi, > > On Sun, Sep 9, 2012 at 12:27 PM, Andris Pavenis wrote: >> -_STDC_VERSION__ is not defined in many cases any recent GCC version. It is >> only seems to be defined in several cases depending on the command line >> parameter -std and for C language only > >> Some examples: >> >> [andris AT ap ~]$ i586-pc-msdosdjgpp-gcc -dD -E -std=c99 -x c /dev/null | grep >> STDC > > You forgot "-std=iso9899:199409 (aka, C94 or C95 or AMD1 or NA1), > which first added all that wchar crud. :-P Well I initially took some examples only. Now I extracted allowed values from GCC development version sources and even built ancient gcc-2.95.3 for Linux ix86 (no x86_64 support available for gcc-2.95.3). The result is that I did not find any combination when __STDC_VERSION__ is defined and and is less than 199901L Test script (editing compiler list required) and results are in attachments. I did the tests under Linux Andris --------------080001030002020206080903 Content-Type: application/x-shellscript; name="std-opt.sh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="std-opt.sh" IyEgL2Jpbi9zaAoKc3JjPSdpbnQgc3RkY3YgPSBfX1NURENfVkVSU0lPTl9fIDsnCgpmb3Ig Q0MgaW4gL29wdC90ZXN0L2Jpbi9nY2MgZ2NjMzQgZ2NjIC9vcHQvY2hyb290L2NlbnRvcy01 LWkzODYvdXNyL2Jpbi9nY2MgaTU4Ni1wYy1tc2Rvc2RqZ3BwLWdjYyA7CmRvCmVjaG8gIioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioiCiRDQyAtdiAyPiYxCgpmb3Igc3RkIGluICIiIGMrKzk4IGMrKzAzIGMrKzExIGMrKzB4 IGMrKzF5IGMxMSBjMXggYzg5IGM5MCBjOTkgYzl4IGdudSsrOTggXAogICAgZ251KyswMyBn bnUrKzExIGdudSsrMHggZ251KysxeSBnbnUxMSBnbnUxeCBnbnU4OSBnbnU5MCBnbnU5OSBn bnU5eCBcCiAgICBpc285ODk5OjE5OTAgaXNvOTg5OToxOTk0MDkgaXNvOTg5OToxOTk5IGlz bzk4OTk6MTk5eCBpc285ODk5OjIwMTE7CmRvCiAgICBjYXNlICRzdGQgaW4KICAgICAgICAq KysqKSBsYW5nPWMrKyA7OwogICAgICAgICopIGxhbmc9YyA7OwogICAgZXNhYwogICAgCiAg ICBjbWQ9IiRDQyAtRSAteCAkbGFuZyIKICAgIGlmICEgdGVzdCAteiAiJHN0ZCIgOyB0aGVu IGNtZD0iJGNtZCAtc3RkPSRzdGQiOyBmaQogICAgY21kPSIkY21kIC0gIgogICAgCiAgICBy bSAtZiBzLXN0ZC1jaGVjawogICAgdmFsPSQoICggZWNobyAiJHNyYyIgfCAkY21kIDI+L2Rl di9udWxsICYmIHRvdWNoIHMtc3RkLWNoZWNrICkgfCBhd2sgJyQyPT0ic3RkY3YiIHsgcHJp bnQgJDQgfScgKQogICAgaWYgdGVzdCAtZiBzLXN0ZC1jaGVjayA7IHRoZW4KICAgICAgICBw cmludGYgIiUtMTZzICUtM3MgJXNcbiIgJHN0ZCAkbGFuZyAkKGVjaG8gJHZhbCB8IHNlZCAt ZSAnczpfX1NURENfVkVSU0lPTl9fOjpnJykKICAgIGZpCmRvbmUKZG9uZQogCg== --------------080001030002020206080903 Content-Type: text/plain; charset=UTF-8; name="std-opt-check.out" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="std-opt-check.out" ********************************************************** Reading specs from /opt/test/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs gcc version 2.95.3 20010315 (release) c 199409L c++98 c++ 199409L c++03 c++ 199409L c++11 c++ 199409L c++0x c++ 199409L c++1y c++ 199409L c11 c 199409L c1x c 199409L c89 c 199409L c90 c 199409L c99 c 199409L c9x c 199409L gnu++98 c++ 199409L gnu++03 c++ 199409L gnu++11 c++ 199409L gnu++0x c++ 199409L gnu++1y c++ 199409L gnu11 c 199409L gnu1x c 199409L gnu89 c 199409L gnu90 c 199409L gnu99 c 199409L gnu9x c 199409L iso9899:1990 c 199409L iso9899:199409 c 199409L iso9899:1999 c 199409L iso9899:199x c 199409L iso9899:2011 c 199409L ********************************************************** Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=x86_64-redhat-linux Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-24.fc17) c c++98 c++ c89 c c99 c 199901L c9x c 199901L gnu++98 c++ gnu89 c gnu99 c 199901L gnu9x c 199901L iso9899:1990 c iso9899:199409 c 199409L iso9899:1999 c 199901L iso9899:199x c 199901L ********************************************************** Using built-in specs. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.0/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) c c++98 c++ c++03 c++ c++11 c++ c++0x c++ c11 c 201112L c1x c 201112L c89 c c90 c c99 c 199901L c9x c 199901L gnu++98 c++ gnu++03 c++ gnu++11 c++ gnu++0x c++ gnu11 c 201112L gnu1x c 201112L gnu89 c gnu90 c gnu99 c 199901L gnu9x c 199901L iso9899:1990 c iso9899:199409 c 199409L iso9899:1999 c 199901L iso9899:199x c 199901L iso9899:2011 c 201112L ********************************************************** Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-52) c c++98 c++ c89 c c99 c 199901L c9x c 199901L gnu++98 c++ gnu89 c gnu99 c 199901L gnu9x c 199901L iso9899:1990 c iso9899:199409 c 199409L iso9899:1999 c 199901L iso9899:199x c 199901L ********************************************************** Using built-in specs. COLLECT_GCC=i586-pc-msdosdjgpp-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-pc-msdosdjgpp/4.8.0/lto-wrapper Target: i586-pc-msdosdjgpp Configured with: ../gnu/gcc-4.80-20120906/configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=i586-pc-msdosdjgpp --program-prefix=i586-pc-msdosdjgpp- --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-nls --disable-lto --enable-libquadmath-support --with-gmp=/home/andris/rpm_root/BUILD/djcross-gcc-4.8.0_20120906/tmpinst --with-mpfr=/home/andris/rpm_root/BUILD/djcross-gcc-4.8.0_20120906/tmpinst --with-mpc=/home/andris/rpm_root/BUILD/djcross-gcc-4.8.0_20120906/tmpinst --enable-version-specific-runtime-libs --enable-languages=c,c++,f95,objc,obj-c++,ada Thread model: single gcc version 4.8.0 20120906 (experimental) (GCC) c c++98 c++ c++03 c++ c++11 c++ c++0x c++ c++1y c++ c11 c 201112L c1x c 201112L c89 c c90 c c99 c 199901L c9x c 199901L gnu++98 c++ gnu++03 c++ gnu++11 c++ gnu++0x c++ gnu++1y c++ gnu11 c 201112L gnu1x c 201112L gnu89 c gnu90 c gnu99 c 199901L gnu9x c 199901L iso9899:1990 c iso9899:199409 c 199409L iso9899:1999 c 199901L iso9899:199x c 199901L iso9899:2011 c 201112L --------------080001030002020206080903--