Article View: comp.std.c
Article #641Re: Declarations in switches, errors
From: Walter Murray
Date: Fri, 29 Sep 1989 18:27
Date: Fri, 29 Sep 1989 18:27
17 lines
1038 bytes
1038 bytes
Concerning initialization of variables in a switch statement, please note that the dpANS only repeats what was spelled out in the original K&R: "Usually the statement that is the subject of a switch is compound. Declarations may appear at the head of this statement, but initializations of automatic or register variables are ineffective." Page 203. And the dpANS document does suggest this as a common situation for a warning: "A block with initialization of an object that has automatic storage duration is jumped into." Section A.5. Walter Murray -------------
Technical Details
Message-ID:
<12570027@hpclwjm.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!brutus.cs.uiuc.edu!psuvax1!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walterReferences:
<561@crdos1.crd.ge.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!brutus.cs.uiuc.edu!psuvax1!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.std.c Subject: Re: Declarations in switches, errors Message-ID: <12570027@hpclwjm.HP.COM> Date: 29 Sep 89 18:27:00 GMT References: <561@crdos1.crd.ge.COM> Organization: Hewlett-Packard Calif. Language Lab Lines: 17