Declarations in switches, errors

Alan J Rosenthal flaps at dgp.toronto.edu
Fri Oct 13 09:17:02 AEST 1989


davidsen at crdos1.crd.ge.COM (Wm E Davidsen Jr) writes:
>>>I submit that executing a switch statement constitutes "normal entry"

kremer at cs.odu.edu (Lloyd Kremer) writes:
>>No, a switch statement is entered by a jump to a label.

diamond at csl.sony.co.jp (Norman Diamond) writes:
>Mr. Kremer, you start your reply with "No."  So you think that correct
>execution of a switch statement constitutes abnormal entry to the block.
>I conjecture that very few will agree with you.

A point generally being missed in this discussion is that "normal entry" is a
precise term.  It is not just whatever method you personally usually choose to
enter a block with a particular wrapper.  It is the method of entering a block
in general which is called "normal entry" by the standard.  I can't find a
definition of "normal entry", but I do find the following, 3.1.2.4, January
1988 draft:

	... automatic storage duration.  Storage is guaranteed to be reserved
	for a new instance of such an object on each normal entry into the
	block in which it is declared, or on a jump from outside the block to a
	label in the block or in an enclosed block.  If an initialization is
	specified for the value stored in the object, it is performed on each
	normal entry, but not if the block is entered by a jump to a label.

I think this is extremely clear.

ajr

--
Vs encr vf n xvaq bs frk, gura n chapu va gur zbhgu vf n xvaq bs gnyxvat.



More information about the Comp.std.c mailing list