> I guess even the very early compilers were optimizing while (1) {...}
> into infinite loop - they did not emit code to check that 1 is != 0.

Well it made a difference on the pdp11 C compiler in 1980 which is when
I was taught to use "forever" 'for (;;)'  rather than "while true"
'while (1)'.

Old habits die hard and while it makes no practical difference with modern
compilers I still think the former looks better, and the operation stands
out more in big blocks of code.

Optimisers don't always do as well as you expect btw.  Only yesterday a
colleague pointed out a case where it was better to use div() rather than
relying on the optimiser to spot that you were using both quotient and
remainder of the same expression.  Same version of C compiler would spot
the optimisation on x86 platforms but miss it entirely on ARM.
-- 
        Bob Dunlop
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to