Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ncrlnk!wright!thor.wright.edu From: bkottman@thor.wright.edu (Brett Kottmann) Newsgroups: comp.lang.c Subject: Re: The final word on GOTO (Don't I wis Message-ID: <725@thor.wright.EDU> Date: 4 Oct 89 18:51:14 GMT References: <6396@ficc.uu.net> Sender: news@wright.EDU Reply-To: bkottman@thor.wright.edu Distribution: na Lines: 41 From article <6396@ficc.uu.net>, by peter@ficc.uu.net (Peter da Silva): / The last time I looked at a stdio library there was a goto in _doprnt: / / if you see a % / handle number.number stuff / see what the format is / / switch(format) { / case 'd': / base = 10; / if(number < 0) { / sign = '-'; / number = -number; / } else / sign = 0; / ... / goto donum; / case 'u': / base = 10; / sign = 0; / ... / goto donum; / case 'o': / base = 8; / sign = 0; / ... / goto donum; / case 'x': / base = 16; / sign = 0; / ... / goto donum; / donum: / format number with base, sign, etc. / This must be really old code since in C, execution falls through to the next case anywasy; in every case without the goto, it would hit donum: anyways...(albiet after trying the rest of the case statements) A break usually replaces the goto in that type of code.