Enable -Wuninitialized, -Wempty-body, -Wignored-qualifiers, -Wunused

This commit is contained in:
Kp 2015-03-22 18:49:21 +00:00
parent 91d31b1952
commit 945914f1d6
3 changed files with 6 additions and 7 deletions

View file

@ -1446,7 +1446,7 @@ class DXXCommon(LazyObjectConstructor):
# gcc 4.5 silently ignores -Werror=undef. On gcc 4.5, misuse
# produces a warning. On gcc 4.7, misuse produces an error.
Werror = get_Werror_string(self.user_settings.CXXFLAGS)
self.env.Append(CCFLAGS = ['-Wall', Werror + 'missing-declarations', Werror + 'pointer-arith', Werror + 'undef', Werror + 'type-limits', '-funsigned-char', Werror + 'format-security'])
self.env.Append(CCFLAGS = ['-Wall', Werror + 'missing-declarations', Werror + 'pointer-arith', Werror + 'undef', Werror + 'type-limits', Werror + 'uninitialized', Werror + 'empty-body', Werror + 'ignored-qualifiers', Werror + 'unused', '-funsigned-char', Werror + 'format-security'])
self.env.Append(CPPPATH = ['common/include', 'common/main', '.', self.user_settings.builddir])
self.env.Append(CPPFLAGS = SCons.Util.CLVar('-Wno-sign-compare'))
if (self.user_settings.editor == 1):

View file

@ -110,10 +110,5 @@ void hostage_compress_all() {
}
}
}
for (int i=0; i<MAX_HOSTAGES; i++ ) {
if ( hostage_is_valid(i) )
;
}
}

View file

@ -1095,12 +1095,16 @@ static bool compare_func(const render_compare_context_t &c, const render_state_t
//the afterburner blobs, though.
if (obj_a->type == OBJ_WEAPON || (obj_a->type == OBJ_FIREBALL && obj_a->id != VCLIP_AFTERBURNER_BLOB))
{
if (!(obj_b->type == OBJ_WEAPON || obj_b->type == OBJ_FIREBALL))
return true; //a is weapon, b is not, so say a is closer
else; //both are weapons
//both are weapons
}
else
{
if (obj_b->type == OBJ_WEAPON || (obj_b->type == OBJ_FIREBALL && obj_b->id != VCLIP_AFTERBURNER_BLOB))
return false; //b is weapon, a is not, so say a is farther
}
//no special case, fall through to normal return
}