Why the error of - calling the function before being declared, is not shown?

后端 未结 3 1141
北海茫月
北海茫月 2020-12-22 02:21
main()
{
    f();
}
int f( int i, float fl)
{
    printf(\"function\");
}
  1. Why does the above code runs successfully in \'C\' and prints

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-22 03:07

    The error does not show in C because you're not using the proper flags in the invocation of your compiler.

    What is your compiler?

    If it's gcc, try gcc -std=c99 -pedantic -Werror ...

提交回复
热议问题