Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!phoenix.Princeton.EDU!subbarao From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Newsgroups: comp.sys.sgi Subject: Re: C Bug (he meekly asks) ? Message-ID: <7578@idunno.Princeton.EDU> Date: 27 Mar 91 15:25:17 GMT References: <6627@oasys.dt.navy.mil> <1991Mar26.235622.20057@colorado.edu> Sender: news@idunno.Princeton.EDU Lines: 19 In article <1991Mar26.235622.20057@colorado.edu> rainer@boulder.Colorado.EDU (Rainer Malzbender) writes: >I inadvertently typed "case_3:" instead of "case 3:" in a 'switch' >statement. Now I'm certainly no guru on the arcane features of the >C language, but shouldn't this be illegal and at least cause a >compiler error? My program compiled and ran fine. As far as I can tell >from the .s output (I don't grok R3000 assembler) it just trashed >the whole clause. Realize that ':' also stands for a label in C, and so your case_3: statement was treated as a label, where later in the program you could possibly say "goto case_3". Certainly not what you intended, but nevertheless quite legal. -Kartik -- internet# find . -name core -exec cat {} \; |& tee /dev/tty* subbarao@phoenix.Princeton.EDU -| Internet kartik@silvertone.Princeton.EDU (NeXT mail) SUBBARAO@PUCC.BITNET - Bitnet