Add -Wempty-statement, which warns about empty statements, i.e. lone ';'
[cparser] / warning.c
index 7a718cd..8f5bfc8 100644 (file)
--- a/warning.c
+++ b/warning.c
@@ -18,6 +18,7 @@ void set_warning_opt(const char *const opt)
 #define SET(y)    warning.y = state;
 #define OPT(x, y) OPTX(x) SET(y)
        OPT("char-subscripts",               char_subscripts)
+       OPT("empty-statement",               empty_statement)
        OPT("error",                         s_are_errors)
        OPT("fatal-errors",                  fatal_errors)
        OPT("format",                        check_format)
@@ -31,6 +32,8 @@ void set_warning_opt(const char *const opt)
        OPT("missing-prototypes",            missing_prototypes)
        OPT("redundant-decls",               redundant_decls)
        OPT("strict-prototypes",             strict_prototypes)
+       OPT("switch-default",                switch_default)
+       OPT("unknown-pragmas",               unknown_pragmas)
 #if 0
        OPTX("unused") {
                SET(unused_function)
@@ -52,11 +55,16 @@ void set_warning_opt(const char *const opt)
 warning_t warning = {
        .char_subscripts               = true,
        .check_format                  = true,
+       .empty_statement               = true,
+       .fatal_errors                  = false,
        .implicit_function_declaration = true,
        .implicit_int                  = true,
        .missing_declarations          = true,
        .missing_prototypes            = true,
-       .strict_prototypes             = true,
        .redundant_decls               = true,
+       .s_are_errors                  = false,
+       .strict_prototypes             = true,
+       .switch_default                = false,
+       .unknown_pragmas               = true,
        .unused_value                  = true
 };