Make wreturn-type an error, not a warning?

Viewed 72

I am on gcc, it gave me a warning that i forgot a return value in a function with Wreturn-type.

However, I don't want it to be a warning, I want it to be an actual compiler error. Is there a way to stop compiling when Wreturn-type is encountered?

1 Answers

Is there a way to stop compiling when Wreturn-type is encountered?

You can make any warning an error with:

-Werror=return-type

You can make gcc "stop" compiling on errors with:

-Wfatal-errors 

Make sure to read your compiler documentation.

Related