problems/risks due to programming language
Steve Mawer
scm at dlcq15.datlog.co.uk
Wed Mar 7 22:33:51 AEST 1990
In article <669 at mwtech.UUCP> martin at 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 <scm at datlog.co.uk> or < {backbone}!ukc!datlog!scm >
Voice: +44 1 863 0383 (x2153)
More information about the Comp.lang.c
mailing list