.return_type = true,
.s_are_errors = false,
.shadow = false,
+ .shadow_local = false,
.sign_compare = false,
.strict_prototypes = true,
.switch_default = false,
put_help("-Wredundant-decls", "");
put_help("-Wreturn-type", "");
put_help("-Wshadow", "");
+ put_help("-Wshadow-local", "");
put_help("-Wsign-compare", "");
put_help("-Wstrict-prototypes", "");
put_help("-Wswitch-default", "");
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)
SET(implicit_int);
SET(init_self);
SET(main);
+ SET(missing_declarations);
SET(nonnull);
SET(parentheses);
SET(pointer_arith);
SET(redundant_decls);
SET(return_type);
- SET(shadow);
+ SET(shadow_local);
SET(sign_compare);
SET(strict_prototypes);
SET(switch_enum);
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);
// TODO SET(incomplete_aggregate_init);
// TODO SET(missing_field_initializers);
// TODO SET(pointless_comparison);
+ SET(shadow);
SET(unused_parameter);
SET(unused_value);
}
OPT("redundant-decls", redundant_decls);
OPT("return-type", return_type);
OPT("shadow", shadow);
+ OPT("shadow-local", shadow_local);
OPT("sign-compare", sign_compare);
OPT("strict-prototypes", strict_prototypes);
OPT("switch-default", switch_default);