Article View: comp.std.c
Article #613Re: Declarations in switches, errors
From: Conor P. Cahill
Date: Thu, 28 Sep 1989 00:43
Date: Thu, 28 Sep 1989 00:43
22 lines
1213 bytes
1213 bytes
In article <10041@xanth.cs.odu.edu>, kremer@cs.odu.edu (Lloyd Kremer) writes: > No, a switch statement is entered by a jump to a label. The jump is to > any one of several places depending on which "case" is true, but an automatic > initialization at the start of a switch statement is never performed. The > variable is brought into scope within the switch block, but the initial > contents of the variable are garbage. If this is the standard, I think it is broken. If the compiler allows a variable declaration, it should allow an initialization. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+
Technical Details
Message-ID:
<1202@virtech.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!virtech!cpcahilReferences:
<561@crdos1.crd.ge.COM> <10041@xanth.cs.odu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.std.c Subject: Re: Declarations in switches, errors Message-ID: <1202@virtech.UUCP> Date: 28 Sep 89 00:43:19 GMT References: <561@crdos1.crd.ge.COM> <10041@xanth.cs.odu.edu> Organization: Virtual Technologies Inc Lines: 22