On Tuesday 02 November 2010 09:22, Bob Dunlop wrote:
> > 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.
Yes. But in such an obvious case, they are expected to. At least
in year 2010, even the old ones (meaning "ten years old")
still in use are expected to.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox