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,
18 .strict_prototypes = true,
19 .switch_default = false,
20 .unknown_pragmas = true,
21 .unused_function = false,
22 .unused_label = false,
23 .unused_parameter = false,
25 .unused_variable = false
28 void set_warning_opt(const char *const opt)
35 if (s[0] == 'n' && s[1] == 'o' && s[2] == '-') {
41 #define OPTX(x) else if (strcmp(s, x) == 0)
42 #define SET(y) warning.y = state;
43 #define OPT(x, y) OPTX(x) SET(y)
48 SET(implicit_function_declaration)
52 SET(strict_prototypes)
61 OPT("char-subscripts", char_subscripts)
62 OPT("empty-statement", empty_statement)
63 OPT("error", s_are_errors)
66 // TODO SET(function_end_without_return)
68 // TODO SET(incomplete_aggregate_init)
69 // TODO SET(pointless_comparison)
70 // TODO SET(sign_compare)
74 OPT("fatal-errors", fatal_errors)
75 OPT("float-equal", float_equal)
76 OPT("format", check_format)
78 SET(implicit_function_declaration)
81 OPT("implicit-function-declaration", implicit_function_declaration)
82 OPT("implicit-int", implicit_int)
84 OPT("missing-declarations", missing_declarations)
85 OPT("missing-prototypes", missing_prototypes)
86 OPT("redundant-decls", redundant_decls)
87 OPT("strict-prototypes", strict_prototypes)
88 OPT("switch-default", switch_default)
89 OPT("unknown-pragmas", unknown_pragmas)
97 OPT("unused-function", unused_function)
98 OPT("unused-label", unused_label)
99 OPT("unused-parameter", unused_parameter)
100 OPT("unused-value", unused_value)
101 OPT("unused-variable", unused_variable)
106 fprintf(stderr, "warning: ignoring unknown option -W%s\n", opt);