Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

treat "implicit declaration of function foo" as error

Tags:

c

gcc

GCC gives a warning implicit declaration of function foo when you use foo() before its declaration. Is there any GCC flag that would make treat this warning as error and stop compilation? Sometime it would save you some debugging work...

like image 681
Jakub M. Avatar asked Jan 28 '12 14:01

Jakub M.


1 Answers

-Werror will treat all warnings as errors. You can be more specific with -Werror-implicit-function-declaration

like image 145
William Pursell Avatar answered Sep 24 '22 07:09

William Pursell