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: [RFC/PATCH] Standardize on "for (;;)" for unbounded loops


On Oct 29, 2006, at 9:54 AM, Roger Sayle wrote:
Now that we're back in stage 1, I'd like to (re)propose the following
minor tweak to GCC's coding style.

[1]	while (1)
	  ...;

[3]	for (;;)
	  ...;

The oracle has considered your request:


$ grep 'while (1)' *.[hc] */*.[ch] */*/*.[ch] | wc -l
     210
$ grep 'for (;;)' *.[hc] */*.[ch] */*/*.[ch] | wc -l
     177

while (1) wins. :-) I personally prefer the while (1) version, further it is by far, easier on the eyes and brain. I wonder that google would say. [ pause ] 179,000 for while (1) to 119,000 for for (;;). Again, the choice is clear.


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