Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.std.c
Subject: Re: Declarations in switches, errors
Message-ID: <19907@mimsy.UUCP>
Date: 1 Oct 89 05:32:51 GMT
References: <561@crdos1.crd.ge.COM> <11158@smoke.BRL.MIL> <637@crdos1.crd.ge.COM> <30540@news.Think.COM>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 22
In article <30540@news.Think.COM> barmar@kulla (Barry Margolin) writes:
>Here's something I think is closer to the original poster's complaint:
>why does the standard permit initializers in declarations at the head
>of a switch body, if they are required to be ignored?
It makes the language simpler conceptually: all variable declarations
are of the form
[, ]* ;
Even a compiler that is only 1/3 decent% will warn about unreachable
initialisers.
Note that the s are, as Doug has already pointed
out (it seems to require a great deal of repetition to get these to sink
in), treated as though they were executable statements when they apply
to automatic (as opposed to static or global) variables.
-----
% 1/3: `less than half'
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris@cs.umd.edu Path: uunet!mimsy!chris