
Envoyé par
koala01
Si tu compile en C
1 2 3 4 5 6 7 8 9 10
| int main(int argc, char** argv) {
int square(int x)
{
return x*x;
}
int a =2;
printf("square(%d) = %d\n",a,square(a));
return (0);
} |
avec uniquement le flag -ansi, il acceptera, sans même un avertissement.
Salut,
Chez moi (mingw 4.4.0), sur ce code, avec la compilation :
mingw32-gcc.exe -Wall -pedantic -W -ansi -g -Wmain
j'ai :
warning: ISO C forbids nested functions
Je ne savais même pas qu'en C c'était interdit tellement j'ai vu ce genre de choses dans du code existant.
Partager