{
const entity_t *entity = get_irg_loc_description(irg, pos);
- if (entity != NULL) {
+ if (entity != NULL && warning.uninitialized) {
warningf(&entity->base.source_position,
"%s '%#T' might be used uninitialized",
get_entity_kind_name(entity->kind),
.switch_default = false,
.switch_enum = false,
.traditional = false,
+ .uninitialized = true,
.unknown_pragmas = true,
.unreachable_code = false,
.unused_function = false,
SET(sign_compare);
SET(strict_prototypes);
SET(switch_enum);
+ SET(uninitialized);
SET(unknown_pragmas);
SET(unreachable_code);
SET(unused_function);
OPT("switch-default", switch_default);
OPT("switch-enum", switch_enum);
OPT("traditional", traditional);
+ OPT("uninitialized", uninitialized);
OPT("unknown-pragmas", unknown_pragmas);
OPT("unreachable-code", unreachable_code);
OPTX("unused") {
bool traditional:1; /**< Warn about certain constructs that behave differently in traditional and ISO C */
#if 0 // TODO
bool undef:1; /**< Warn if an undefined identifier is evaluated in an '#if' directive */
- bool uninitialized:1; /**< Warn if an automatic variable is used without being initialized or if a variable may be clobbered by a 'setjmp' call. */
#endif
+ bool uninitialized:1; /**< Warn if an automatic variable is used without being initialized or if a variable may be clobbered by a 'setjmp' call. */
bool unknown_pragmas:1; /**< Warn when a #pragma directive is encountered which is not understood */
bool unreachable_code:1; /**< Warn if the compiler detects that code will never be executed */
bool unused_function:1; /**< Warn whenever a static function is declared but not defined or a non-inline static function is unused */