.It Fl Werror-implicit-function-declaration
Generate an error, when calling a function without a prior declaration.
.It Fl Wextra
+(Alias
+.Fl W Ns )
Activate some more warnings.
In particular these are
.Fl Wempty-statement ,
static void print_help_warnings(void)
{
put_help("-w", "disable all warnings");
- put_help("-W", "ignored (gcc compatibility)");
put_help("-Wno-trigraphs", "warn if input contains trigraphs");
put_help("-Wundef", "Warn if an undefined macro is used in an #if");
print_warning_opt_help();
}
}
} else if (option[0] == 'W') {
- if (option[1] == '\0') {
- /* ignore -W, our defaults are already quite verbose */
- } else if (strstart(option + 1, "p,")) {
+ if (strstart(option + 1, "p,")) {
// pass options directly to the preprocessor
const char *opt;
GET_ARG_AFTER(opt, "-Wp,");
state = false;
}
- if (0) {}
+ if (s[0] == '\0') { // -W is an alias for -Wextra
+ goto extra;
+ }
#define OPTX(x) else if (strcmp(s, x) == 0)
#define SET(y) (void)(warning.y = state)
#define OPT(x, y) OPTX(x) SET(y)
OPT("error", s_are_errors);
OPT("error-implicit-function-declaration", error_implicit_function_declaration);
OPTX("extra") {
+extra:
/* TODO */
// TODO SET(function_end_without_return);
SET(empty_statement);