CBFalconer <cb********@yah oo.comwrites:
Serve Laurijssen wrote:
"Keith Thompson" <ks***@mib.orgw rote in message
Jorgen Grahn <gr********@sni pabacken.dyndns .orgwrites:
... snip ...
>>
gcc -W -Wall -pedantic -std=c89
or
gcc -W -Wall -pedantic -std=c99
The latter doesn't entirely conform to the C99 standard;
it might or might not be close enough for your purposes.
See <http://gcc.gnu.org/c99status.html> .
Wow, is there a reason that this is *still* not finished?
Partially because gcc depends on local libraries, which are not
automatically updated, but belong to the individual system. I
believe most things that can be completely handled within the
compiler have been dealt with.
(This is about a specific compiler, but I claim it's topical because
it's also about the status of the C99 standard.)
Most, but not all. The items that, as far as I can tell, still
require compiler work are:
variable-length arrays
listed as "Broken"
complex (and imaginary) support in <complex.h>
This isn't listed as a library issue; I don't know why.
extended identifiers
Missing
extended integer types in <stdint.h>
Listed as Missing
I'm not sure what this one means. C99 allows, but does not
require, extended integer types. See C99 6.2.5p4. I'm not aware
that gcc provides any extended integer types -- but if it does,
there might be a requirement for <stdint.hto use some of them.
IEC 60559 (also known as IEC 559 or IEEE arithmetic) support
Broken
inline functions
Broken
additional predefined macro names
Missing
I don't know what this refers to; gcc 4.1.1 seems to support all the
names specified in C99 6.10.8. See below for more information.
standard pragmas
Missing
I haven't looked into this.
Here's a program that shows the values of all the required and
optional predefined macros from 6.10.8:
#include <stdio.h>
int main(void)
{
#ifdef __DATE__
puts("__DATE__ = \"" __DATE__ "\"");
#else
printf("__DATE_ _ is not defined");
#endif
#ifdef __FILE__
puts("__FILE__ = \"" __FILE__ "\"");
#else
printf("__FILE_ _ is not defined");
#endif
#ifdef __LINE__
printf("__LINE_ _ = %d\n", (int)__LINE__);
#else
printf("__LINE_ _ is not defined");
#endif
#ifdef __STDC__
printf("__STDC_ _ = %d\n", (int)__STDC__);
#else
printf("__STDC_ _ is not defined");
#endif
#ifdef __STDC_HOSTED__
printf("__STDC_ HOSTED__ = %d\n", (int)__STDC_HOS TED__);
#else
printf("__STDC_ HOSTED__ is not defined");
#endif
#ifdef __STDC_VERSION_ _
printf("__STDC_ VERSION__ = %ld\n", (long)__STDC_VE RSION__);
#else
printf("__STDC_ VERSION__ is not defined");
#endif
#ifdef __TIME__
puts("__TIME__ = \"" __TIME__ "\"");
#else
printf("__TIME_ _ is not defined");
#endif
#ifdef __STDC_IEC_559_ _
printf("__STDC_ IEC_559__ = %d\n", (int)__STDC_IEC _559__);
#else
printf("__STDC_ IEC_559__ is not defined");
#endif
#ifdef __STDC_IEC_559_ COMPLEX__
printf("__STDC_ IEC_559_COMPLEX __ = %d\n", (int)__STDC_IEC _559_COMPLEX__) ;
#else
printf("__STDC_ IEC_559_COMPLEX __ is not defined");
#endif
#ifdef __STDC_ISO_1064 6__
printf("__STDC_ ISO_10646__ = %ld\n", (long)__STDC_IS O_10646__);
#else
printf("__STDC_ ISO_10646__ is not defined");
#endif
return 0;
}
And here's the output under gcc 4.1.1:
__DATE__ = "Jan 22 2007"
__FILE__ = "macros.c"
__LINE__ = 18
__STDC__ = 1
__STDC_HOSTED__ = 1
__STDC_VERSION_ _ = 199901
__TIME__ = "14:35:02"
__STDC_IEC_559_ _ = 1
__STDC_IEC_559_ COMPLEX__ = 1
__STDC_ISO_1064 6__ = 200009
Possibly the web page doesn't reflect the latest release, and/or
perhaps some of the macro values don't quite reflect reality.
--
Keith Thompson (The_Other_Keit h)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.