Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.std.c Subject: Re: Scope of switch statements Message-ID: <1989Nov14.104203.26192@gdt.bath.ac.uk> Date: 14 Nov 89 10:42:03 GMT References: <15743@bloom-beacon.MIT.EDU> <1989Nov9.200639.8868@utzoo.uucp> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 21 In article <1989Nov9.200639.8868@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <15743@bloom-beacon.MIT.EDU> tada@athena.mit.edu (Michael J Zehr) writes: >>is this obfuscated code not ANSI or is the compiler broken? > >It is legal, although ugly, ANSI C. Also legal (but ugly) traditional C. >Dennis Ritchie himself has officially blessed this disgusting construct, >and indeed it has one or two legitimate uses. Can you point me at a reference in 'The C programming language' (or in any other reference that I'm likely to be able to find)? I'm *not* doubting you, but I *would* like to know exactly what it is supposed to mean, then. In particular, if you branch (via the switch) to one of the cases inside the {}'s of the for, are you then under control of the for? That is, do you iterate the for or do you fall out of the bottom bracket on the first go-through? -- Paul Smee | JANET: Smee@uk.ac.bristol Computer Centre | BITNET: Smee%uk.ac.bristol@ukacrl.bitnet University of Bristol | Internet: Smee%uk.ac.bristol@nsfnet-relay.ac.uk (Phone: +44 272 303132) | UUCP: ...!uunet!ukc!gdr.bath.ac.uk!exspes