[Scummvm-devel] Enabling -Wparentheses in the Makefile

Johannes Schickel lordhoto at gmail.com
Mon Mar 30 01:06:00 CEST 2009


Ori Avtalion schrieb:
> I'd like to argue for the inclusion of -Wparentheses in the Makefile.
>
> While it is sometimes pedantic in its requirements, I find it very useful.
>
> It has helped catch two bugs in ScummVM, related to missing parentheses
> in expressions like "a && b || c", and a bug in my own KoM code where I
> typed "&" instead of "&&".
>
> I'm attaching a patch that silences the current warnings in the code. It
> highlights the various areas that it warns upon, so you can judge for
> yourself whether it's a good thing to have.
>
> I actually found the bug in KoM after sanguine compiled it on MVSC.
> Apparently it's not disabled in the pragmas in common/scummsys.h :)
>
> What do you think?
>   

I'm fine with enabling "-Wparentheses" for g++ 4.3 again. All that 
should be needed to do so is to remove the addition of 
"-Wno-parentheses" to CXXFLAGS in configure line 1907.

// Johannes




More information about the Scummvm-devel mailing list