[Scummvm-devel] Coding convention for empty while body?

Thierry Crozat criezy at scummvm.org
Sat Apr 3 00:28:14 CEST 2010


Hi,

Compiling the tools on my computer (with gcc) gives me two times the  
following warning:
warning: suggest a space before ';' or explicit braces around empty  
body in 'while' statement

This happens in degob_script.cpp (line 582) and extract_cruise_pc.cpp  
(line 171) with code in the form of
while (condition);

I looked at the coding convention page of the wiki and found no  
convention about this. Should we for example fix the convention to  
using braces?
while (condition) {}

In my opinion that makes it more clear that it was intentional to  
have an empty while body. That would also removes the warnings.

Thierry






More information about the Scummvm-devel mailing list