.missing_prototypes = false,
.multichar = true,
.redundant_decls = true,
+ .return_type = true,
.s_are_errors = false,
.shadow = false,
.sign_compare = false,
.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)
/* 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)
SET(unused_parameter)
SET(unused_value)
SET(unused_variable)
- SET(return_type)
}
OPT("attribute", attribute)
OPT("char-subscripts", char_subscripts)
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)
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
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 */
#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;