implicit int and implicit declaration of functions with gcc compiler

后端 未结 3 1030
被撕碎了的回忆
被撕碎了的回忆 2021-01-19 06:24

I read in the c99 Standard:

-remove implicit function declaration,

-remove implicit int.

But when I try to compile this code with gcc comp

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 06:53

    The C standard requires a diagnostic for any translation unit containing a violation of a syntax rule or constraint. It does not require such diagnostics to be fatal; the compiler is free to continue processing the source file. The behavior of the resulting executable, if any, is undefined. The standard makes no distinction between warnings and fatal errors.

    (The only thing that requires a compiler to reject a source file is the #error directive.)

    Conclusion: when compiling C, take warnings very seriously.

提交回复
热议问题