[gcc-in-cxx] Put empty loop ';' on new line

Ben Elliston bje@au1.ibm.com
Mon Feb 2 04:06:00 GMT 2009


> > g++ warns when a loop is terminated by a semicolon with no intervening
> > whitespace.  This patch avoids this warning in several cases by
> > adding a newline and appropriate indentation.  Committed to gcc-in-cxx
> > branch.
> 
> This is probably a stupid question, but why are there empty loops to
> begin with?

These loop constructs employ side effects.  For example, in the loops in
sched-rgn.c, a loop control variable is decremented and then used after
the loop has completed.

Ben




More information about the Gcc-patches mailing list