using break <label> instead of goto <label>

Guy Harris guy at rlgvax.UUCP
Thu Jan 10 09:22:58 AEST 1985


> Please don't attribute to me something I didn't say. I was not advocating
> the elimination of goto's from C, but felt the put-down of the idea of break
> <label> might not have been well thought out.

But what Ron was saying was that if you don't eliminate "goto", "break <label>"
just amounts to "semantic sugar" for "goto <label>"; if you want to discourage
people from using "goto" you can just put

	#define	breakloop	goto

or something like it in a header file.  Putting in a "break" statement which
acts exactly like "goto" but which is only accepted by the compiler in certain
contexts doesn't really add anything to the power of the language.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list