gcc-3.0 pb with macro __STDC_VERSION__

Guillaume Rumeau rumeau@isty-info.uvsq.fr
Wed Jun 20 02:36:00 GMT 2001


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.E
Type: text/x-c
Size: 27300 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20010620/56f84ca8/attachment.bin>


More information about the Gcc-bugs mailing list