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

Francois Bertel francois.bertel at kitware.com
Mon Jun 16 17:26:35 EDT 2008


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.
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



-- 
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
 | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list