Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!stc!datlog!scm From: scm@dlcq15.datlog.co.uk (Steve Mawer) Newsgroups: comp.lang.c Subject: Re: problems/risks due to programming language Message-ID: <1990Mar7.123351.19788@dlcq15.datlog.co.uk> Date: 7 Mar 90 12:33:51 GMT References: <1597@awdprime.UUCP> <8133@hubcap.clemson.edu> <669@mwtech.UUCP> Reply-To: scm@dlcq15.datlog.co.uk (Steve Mawer) Organization: Data Logic Ltd, Queens House, Harrow, Middlesex, HA1 1YR Lines: 18 In article <669@mwtech.UUCP> martin@mwtech.UUCP (Martin Weitzel) writes: > >Finally I would like to add another experience with switch: >Some day, I had written the following piece of code: > switch (x = getsound()) { > DING: /*stuff*/ > break; <----- No, *this* was not missing > } >Do you see, what is wrong with that? >I did not write "case DING:" aso., so DING: was considered to be a >goto-label (and as such had a different name space as enum names and >the program compiled without errors). Yeah, I saw someone spend *ages* finding out why his default case never got executed. Turned out he'd spelt it `defualt'. -- Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)