This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gcc-in-cxx] Revert adding newlines for semicolon in loops
- From: Tom Tromey <tromey at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 May 2009 11:01:09 -0600
- Subject: Re: [gcc-in-cxx] Revert adding newlines for semicolon in loops
- References: <m363g83252.fsf@google.com>
- Reply-to: tromey at redhat dot com
>>>>> "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