Remove duplicate warning entry, sort.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 24 Aug 2008 17:18:46 +0000 (17:18 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 24 Aug 2008 17:18:46 +0000 (17:18 +0000)
[r21413]

warning.c
warning.h

index 42b47b4..b421b72 100644 (file)
--- a/warning.c
+++ b/warning.c
@@ -36,6 +36,7 @@ warning_t warning = {
        .missing_prototypes            = false,
        .multichar                     = true,
        .redundant_decls               = true,
+       .return_type                   = true,
        .s_are_errors                  = false,
        .shadow                        = false,
        .sign_compare                  = false,
@@ -46,8 +47,7 @@ warning_t warning = {
        .unused_label                  = false,
        .unused_parameter              = false,
        .unused_value                  = true,
-       .unused_variable               = false,
-       .return_type                   = true
+       .unused_variable               = false
 };
 
 void set_warning_opt(const char *const opt)
@@ -70,13 +70,14 @@ void set_warning_opt(const char *const opt)
                /* Note: this switched on a lot of more warnings than gcc's -Wall */
                SET(attribute)
                SET(char_subscripts)
-               SET(format)
-               SET(nonnull)
                SET(empty_statement)
+               SET(format)
                SET(implicit_function_declaration)
                SET(implicit_int)
                SET(main)
+               SET(nonnull)
                SET(redundant_decls)
+               SET(return_type)
                SET(shadow)
                SET(sign_compare)
                SET(strict_prototypes)
@@ -86,7 +87,6 @@ void set_warning_opt(const char *const opt)
                SET(unused_parameter)
                SET(unused_value)
                SET(unused_variable)
-               SET(return_type)
        }
        OPT("attribute",                     attribute)
        OPT("char-subscripts",               char_subscripts)
@@ -120,6 +120,7 @@ void set_warning_opt(const char *const opt)
        OPT("missing-prototypes",            missing_prototypes)
        OPT("multichar",                     multichar)
        OPT("redundant-decls",               redundant_decls)
+       OPT("return-type",                   return_type)
        OPT("shadow",                        shadow)
        OPT("sign-compare",                  sign_compare)
        OPT("strict-prototypes",             strict_prototypes)
@@ -137,7 +138,6 @@ void set_warning_opt(const char *const opt)
        OPT("unused-parameter",              unused_parameter)
        OPT("unused-value",                  unused_value)
        OPT("unused-variable",               unused_variable)
-       OPT("return-type",                   return_type)
 #undef OPT
 #undef SET
 #undef OPT_X
index a67d136..ee8654b 100644 (file)
--- a/warning.h
+++ b/warning.h
@@ -72,9 +72,7 @@ typedef struct warning_t {
        bool pointer_arith:1;                 /**< Warn about anything that depends on the "size of" a function type or of 'void' */
 #endif
        bool redundant_decls:1;               /**< Warn about redundant declarations */
-#if 0 // TODO
-       bool return_type:1;                   /**< Warn about function definitions with a return-type that defaults to 'int'.  Also warn about any 'return' statement with no return-value in a function whose return-type is not 'void'. */
-#endif
+       bool return_type:1;                   /* TODO not fully implemented */ /**< Warn about function definitions with a return-type that defaults to 'int'.  Also warn about any 'return' statement with no return-value in a function whose return-type is not 'void'. */
        bool s_are_errors:1;                  /**< Treat warnings as errors */
 #if 0 // TODO
        bool sequence_point:1;                /**< Warn about code that may have undefined semantics because of violations of sequence point rules */
@@ -104,7 +102,6 @@ typedef struct warning_t {
 #if 0 // TODO
        bool write_strings:1;                 /**< Give string constants the type 'const char[LENGTH]' so that copying the address of one into a 'char *' pointer will get a warning */
 #endif
-       bool return_type:1;                   /**< Warn whenever a function is defined with a return-type that defaults to `int'.  Also warn about any `return' statement with no return-value in a function whose return-type is not `void'. */
 } warning_t;
 
 extern warning_t warning;