🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #620

Re: Declarations in switches, errors

#620
From: Doug Gwyn
Date: Thu, 28 Sep 1989 04:42
15 lines
954 bytes
In article <1202@virtech.UUCP>, cpcahil@virtech.UUCP (Conor P. Cahill) writes:
> If this is the standard, I think it is broken.  If the compiler allows 
> a variable declaration, it should allow an initialization.

If I recall correctly (my copy of the Standard is not at hand), you can
specify the initializer but of course it won't be executed.  Consider
the following analogous case (which does NOT involve "switch") to see why:

	goto label;
	{
		int i = 4;
		foo();
	label:	bar();
		baz();
	}
Technical Details
Message-ID: <11173@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
References: <561@crdos1.crd.ge.COM> <10041@xanth.cs.odu.edu> <1202@virtech.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Declarations in switches, errors
Message-ID: <11173@smoke.BRL.MIL>
Date: 28 Sep 89 04:42:42 GMT
References: <561@crdos1.crd.ge.COM> <10041@xanth.cs.odu.edu> <1202@virtech.UUCP>
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 15