Zaratruta
Zaratruta

Reputation: 2275

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.

Upvotes: 0

Views: 1976

Answers (2)

abhiarora
abhiarora

Reputation: 10430

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

Upvotes: 0

jdarthenay
jdarthenay

Reputation: 3147

When compiling use -Werror option and all warnings will be considered errors.

Upvotes: 1

Related Questions