[Scummvm-devel] Enabling -Wparentheses in the Makefile

Ori Avtalion ori at avtalion.name
Sun Mar 29 22:14:54 CEST 2009

Hi all,

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?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: parens.patch
Type: text/x-diff
Size: 5553 bytes
Desc: not available
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090329/dd1bbb11/attachment.patch>

More information about the Scummvm-devel mailing list