Implicit function declarations in C

后端 未结 6 1377
你的背包
你的背包 2020-11-22 07:04

What is meant by the term \"implicit declaration of a function\"? A call to a standard library function without including the appropriate header file produces a warning as i

6条回答
  •  太阳男子
    2020-11-22 07:51

    To complete the picture, since -Werror might considered too "invasive",
    for gcc (and llvm) a more precise solution is to transform just this warning in an error, using the option:

    -Werror=implicit-function-declaration
    

    See Make one gcc warning an error?

    Regarding general use of -Werror: Of course, having warningless code is recommendable, but in some stage of development it might slow down the prototyping.

提交回复
热议问题