This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-3.0 pb with macro __STDC_VERSION__
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc-3.0 pb with macro __STDC_VERSION__
- From: Guillaume Rumeau <rumeau at isty-info dot uvsq dot fr>
- Date: 20 Jun 2001 11:36:30 +0200
- Reply-To: Guillaume Rumeau <rumeau at isty-info dot uvsq dot fr>
Hi,
here a little programm that compile correctly with gcc-2.95.2
(linux-gnu-glibc-2.1)
but not correctly with gcc-3.0 in the same architecture.
Is my installation of gcc-3.0 not correct ?
Thank you.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void) {
#ifdef __STDC__
printf("C Version value = %ld\n", __STDC_VERSION__) ;
#else
puts("No C version") ;
#endif
return EXIT_SUCCESS ;
}
/*
Local variables:
mode:c
compile-command: "gcc3 -W -Wall -c test.c"
End:
*/
Error message with gcc-3.0
test.c: In function `main':
test.c:8: `__STDC_VERSION__' undeclared (first use in this function)
After pre-processing :
int main(void) {
printf("C Version value = %ld\n", __STDC_VERSION__) ;
return 0 ;
}
And after gcc-2.95.2 pre-processing :
int main(void) {
printf("C Version value = %ld\n", 199409L) ;
return 0 ;
}
In attached-file, the complete result of gcc-3.0 pre-processing.
test.E
$>gcc3 -v
Reading specs from /usr/local/gcc30/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc-3.0/configure --prefix=/usr/local/gcc30 --with-local-prefix=/usr/local/gcc30 --with-gxx-include-dir=/usr/local/gcc30/include/g++ --enable-shared --enable-languages=c,c++
Thread model: single
gcc version 3.0
--
Guillaume Rumeau <rumeau@isty-info.uvsq.fr>
« L'homme est doué d'une vaste intelligence
qui regarde devant elle et au-delà » (J.L)