implicit int and implicit declaration of functions with gcc compiler

后端 未结 3 1061
被撕碎了的回忆
被撕碎了的回忆 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:54

    Two points: first, it may (usually does) take a specific set of flags to get a compiler to conform with the standard.

    Second, all that's required by the standard is that the implementation issue a "diagnostic" in the case of an error -- but it's up to the implementation to define what is or isn't a diagnostic. It's free to say a "warning" is a diagnostic if it wants to. When a diagnostic is issued, it may quit compiling, or it can compile the code anyway.

    Bottom line: what it's doing is probably enough to conform, for whatever that's worth.

提交回复
热议问题