Re:The first split vote about C compiler random test
by zokier on Thursday July 14, 2011 @04:43AM
(#2762212)
[ Parent
| on HN ]
Re:The first split vote about C compiler random test
by jws on Thursday July 14, 2011 @09:15AM
(#2762850)
This works for the example as typed, but not if there is a body to the original loop.
Re:The first split vote about C compiler random test
by onemoreact on Thursday July 14, 2011 @10:06AM
(#2763068)
A little ugly but you can get it to work without duplicate code by:
bool second_loop = false;
do
{
if (second_loop) {...}
update_thing(&foo);
second_loop = true;
} while (foo != 0);
The real question is which is more clear when some else looks at the code. I suspect even if it's shorter and faster while (foo,bar) is less clear to most people than the above code.