How do I generate an error for a missing return statement under GCC?
cpfsfuse.c:184: warning: no return statement in function returning non-void
I’m able to return errors for implicit function declaration (-Werror-implicit-function-declaration), and I’m aware of a -Werror= switch, but I can’t locate an appropriate warning to promote to error status.
How can I achieve this?
You should be able to use the
-fdiagnostics-show-optionoption to show the correct flag for theWerror=switch. Taken from this blog post:Output
Actually, it looks like the
return-typeflag may be the one you want.