Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!yale!mfci!karzes From: karzes@mfci.UUCP (Tom Karzes) Newsgroups: comp.std.c Subject: Re: Declarations in switches, errors Message-ID: <1055@m3.mfci.UUCP> Date: 3 Oct 89 06:24:29 GMT References: <561@crdos1.crd.ge.COM> Sender: karzes@mfci.UUCP Reply-To: karzes@mfci.UUCP (Tom Karzes) Organization: Multiflow Computer Inc., Branford Ct. 06405 Lines: 10 In article <561@crdos1.crd.ge.COM> davidsen@crdos1.UUCP (bill davidsen) writes: -This is an error in the compilers! As ugly as this is, the ANSI standard -(3.1.2.4) says "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." Switching into a block via a switch statement clearly consitutes entering the block by a jump to a label. No code between the beginning of the block and the case label should be executed, including dynamic initializations of any automatic variables declared in the block.