This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gcc-in-cxx] Revert adding newlines for semicolon in loops


>>>>> "Ian" == Ian Lance Taylor <iant@google.com> writes:

Ian> g++ no longer warns about an empty loop with no whitespace between the
Ian> loop statement and the semicolon.  I committed this patch to the
Ian> gcc-in-cxx branch to revert cases where a newline had been added to
Ian> avoid the g++ warning.

Ian> -	for (n = 0, e = rdg->vertices[i].succ; e; e = e->succ_next, n++)
Ian> -	  ;
Ian> +	for (n = 0, e = rdg->vertices[i].succ; e; e = e->succ_next, n++);

FWIW, I find the variant with the newline much more readable.
The trailing semicolon is too easy to overlook.
How about leaving the newline and declaring this the GCC style?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]