Seven Original Sins of K&R (Long)

Peter Holzer hp at vmars.tuwien.ac.at
Wed Oct 3 01:04:22 AEST 1990


rv at erix.ericsson.se (Robert Virding) writes:

>What's the problem? "break" means break out of the surrounding
>while/for/case. The REAL sin is that "break" ignores a surrounding if.
>This really can cause problems.

Like in:

1:	for (;;) {
2:		/* code */
3:		if (expression) break;
4:		/* more code */
5:	}

If break would break out of the surrounding if, it would not break out
of the loop, so line 3 would just be a noop.

--
|    _	| Peter J. Holzer			| Think of it	|
| |_|_)	| Technische Universitaet Wien		| as evolution	|
| | |	| hp at vmars.tuwien.ac.at			| in action!	|
| __/  	| ...!uunet!mcsun!tuvie!vmars!hp	|     Tony Rand	|



More information about the Comp.lang.c mailing list