Mail Archives: djgpp/2003/07/09/12:15:21
Hans-Bernhard Broeker wrote:
> ahelm AT gmx DOT net wrote:
>
> > Could somebody enlighten me whether nested functions are a GCC or DJGPP
> > extension or whether they are actually part of the C standard.
>
> A GCC extension, as clearly documented here:
>
> info gcc "C Extensions" "Nested Functions"
>
> Another way you can tell is that it will fail to compile if you put
> GCC into ANSI-C-only mode (gcc -ansi -pedantic for GCC 2, something
> else for GCC 3.x).
In GCC 3.x, -pedantic is what is required, but even it will only
generate a warning. (If you really want to prevent compilation
entirely, you need -pedantic-errors). Oddly, -ansi does not diable
the nested function extension, because it only disables extensions
that are "incompatible" with ISO C90.
For most beginners, and for me as well, turning on all, or almost all,
warnings is usually best. This pretty much does it:
-Wall -W -pedantic
For reasons I don't understand, -W turns on warnings that -Wall does
not. I believe there is a proposal (perhaps it was already adopted)
to change the name of -W to something that more clearly expresses what
that compiler option does.
Best regards,
Tom
- Raw text -