6 .char_subscripts = true,
8 .empty_statement = false,
11 .implicit_function_declaration = true,
14 .missing_declarations = false,
15 .missing_prototypes = false,
16 .redundant_decls = true,
17 .s_are_errors = false,
19 .sign_compare = false,
20 .strict_prototypes = true,
21 .switch_default = false,
22 .unknown_pragmas = true,
23 .unused_function = false,
24 .unused_label = false,
25 .unused_parameter = false,
27 .unused_variable = false
30 void set_warning_opt(const char *const opt)
37 if (s[0] == 'n' && s[1] == 'o' && s[2] == '-') {
43 #define OPTX(x) else if (strcmp(s, x) == 0)
44 #define SET(y) warning.y = state;
45 #define OPT(x, y) OPTX(x) SET(y)
47 /* Note: this switched on a lot of more warnings than gcc's -Wall */
51 SET(implicit_function_declaration)
57 SET(strict_prototypes)
65 OPT("char-subscripts", char_subscripts)
66 OPT("empty-statement", empty_statement)
67 OPT("error", s_are_errors)
70 // TODO SET(function_end_without_return)
72 // TODO SET(incomplete_aggregate_init)
73 // TODO SET(pointless_comparison)
74 // TODO SET(sign_compare)
78 OPT("fatal-errors", fatal_errors)
79 OPT("float-equal", float_equal)
80 OPT("format", check_format)
82 SET(implicit_function_declaration)
85 OPT("implicit-function-declaration", implicit_function_declaration)
86 OPT("implicit-int", implicit_int)
88 OPT("missing-declarations", missing_declarations)
89 OPT("missing-prototypes", missing_prototypes)
90 OPT("redundant-decls", redundant_decls)
92 OPT("sign-compare", sign_compare)
93 OPT("strict-prototypes", strict_prototypes)
94 OPT("switch-default", switch_default)
95 OPT("unknown-pragmas", unknown_pragmas)
103 OPT("unused-function", unused_function)
104 OPT("unused-label", unused_label)
105 OPT("unused-parameter", unused_parameter)
106 OPT("unused-value", unused_value)
107 OPT("unused-variable", unused_variable)
112 fprintf(stderr, "warning: ignoring unknown option -W%s\n", opt);