[vtk-developers] gcc warnings about empty if/while bodies

Sean McBride sean at rogue-research.com
Mon Jun 16 18:50:06 EDT 2008


Sorry about the stray ';', darn copy & paste. :)  I assume it should be
a 2 space indent of the braces?


On 6/16/08 5:26 PM, Francois Bertel said:

>Neither (no ";" ) :
>
>3)  while(glGetError() != GL_NO_ERROR)
>     {
>     }
>
>On Mon, Jun 16, 2008 at 5:12 PM, Sean McBride <sean at rogue-research.com>
wrote:
>> Hi all,
>>
>> Apple's newest gcc is giving warnings like:
>>
>> vtkOpenGLRenderWindow.cxx:458: warning: suggest a space before ';' or
>> explicit braces around empty body in 'while' statement
>>
>> for code like:
>>
>>  while(glGetError() != GL_NO_ERROR);
>>
>> There are only 100 or so; I could commit fixes.  But what style of fix?
>> Options:
>>
>> 1)  while(glGetError() != GL_NO_ERROR) ;
>>
>> 2)  while(glGetError() != GL_NO_ERROR) {};
>>
>> Of course, whitespace permutations are also possible. :)  I vote 2.




More information about the vtk-developers mailing list