Wednesday 15 May 2013

c - nested functions in gcc using -std=c99 -


The code below which I am reading is invalid c99, although I think it is gcc -std = C99 which, my The GNU extension for knowledge should be disabled which allows for the embedded function. I do not seem to understand why this is the matter.

  int main () {int E () {printf ("test"); Return 0; }; E (); Return 0; }  

To receive a warning on a non-conformant code, you must -contact also, you will see the following ( ):

  Warning: ISO C forbids nested functions [-weederic] int e () { ^  

To change this in an error, you can use -errorerror to change the alerts to errors or -fendantic-errors < / Code>.

From the GCC document:

To get all the diagnoses necessary for the standard, you should specify - Packing (or -pindi-errors if you want them to be warnings Instead known as errors)


No comments:

Post a Comment