While using gcc
, the code:
register a = 3;
static b = 3;
it is allowed while using the -std=c89 -pedantic-errors
flags, although there is a warning.
However it receive an error with the -std=c99 -pedantic-errors
flags.
I wonder which section of the C89 standards allows the "implicit int" rule?
The section that allowed the implicit int rule in C89 would be section
3.5.2
Type specifiers which says (emphasis mine):Keith Thompson in the comments points out that in C90 the section is
6.5.2
and says, The only difference is some introductory material required by ISO, resulting in a renumbering of the sections.In C99 where this changed, the section is
6.7.2
Type specifiers and it says:This is also covered in document N661: Disallow implicit "int" in declarations which says: