简体   繁体   中英

Implicit declaration of function in C

Is there any version of C, or any compiler that does not allow implicit declaration of functions?

For example. Using mingw compiler, if I use the printf function within my program without including stdio.h, it compiles my program, displaying a warning "incompatible implicit declaration of built-in function 'printf'".

i would like to know if there is some version of C, or some compiler, which does not compile my program in these situations.

Best regards.

编译时使用-Werror选项,所有警告均将视为错误。

You can use -Werror compiler option while compiling your code. It will consider all warning as error . I like to compile my source code using these option.

gcc -Wall -Werror -Wshadow -Wextra SOURCE.c -Wfloat-equal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM