Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!umich!bushido!dbc From: dbc@bushido.uucp (Dave Caswell) Newsgroups: comp.lang.c Subject: Re: Coding Standards. was: a style question Message-ID: <1990Nov20.012547.4857@bushido.uucp> Date: 20 Nov 90 01:25:47 GMT References: <1990Nov18.034120.2963@bushido.uucp> Organization: Bushido Systems of Ann Arbor, Michigan. Lines: 29 I said >>rules like having a single entrance and exit point are good >>ones. They should be written down and strictly enforced. . .Blech! Consider the following example: . >int fubar (x, y, z) >int x, y, z; >{ > if (abnormal_condition_1) > return(foo); > if (abnormal_condition_2) > return(bar); > for (blah; blah; blah) { > do_some_stuff(); > if (screwed_up) > return(foobar); > do_other_stuff(); > } > return(blech); Try modifying this to pass in the error value, or how about if clean-up code has to be written. They're plenty of reasons to think that a goto to ERROR_EXIT: (or whatever), is better than having more than one return statement. -- David Caswell dbc%bushido.uucp@umich.edu