Path: utzoo!utgpu!water!watmath!clyde!att!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: Re: Unnecessary parenthesis Summary: hey, why not. Message-ID: <2801@ttrdc.UUCP> Date: 10 Jul 88 23:06:51 GMT References: <326@marob.MASA.COM> <2550075@hpisod2.HP.COM> <17458@tut.cis.ohio-state.edu> Organization: AT&T, Skokie, IL Lines: 34 In article <17458@tut.cis.ohio-state.edu>, mdf@tut.cis.ohio-state.edu (Mark D. Freeman) writes: > In <2550075@hpisod2.HP.COM> decot@hpisod2.HP.COM (Dave Decot) writes: > >Return is a statement that modifies the default > >flow of control, such as: > > goto label; /* NOT goto(label); */ > > break; /* NOT break(); */ > > continue; /* NOT continue(); */ > >Return is not a function call, and it shouldn't look like one. > >Why do you want to make it easier to confuse function calls > >with statements that don't come back? > What about exit()? Does it require parenthesis? How does it fit into > your argument? Butting in, I say: exit() is a bona fide, real, genuine, honest-to-goodness FUNCTION CALL. It just so happens that the usual effect of calling it (besides miscellaneous cleanup actions, such as flushing any open stdio buffers) is to stop execution of the program that called it. Were you to feel a bit wild and crazy some time, you could perfectly well write your own exit() which could do whatever oddball things it wished and not stop the program at all when called. E.g., exit(i) int i; { printf("nyah nyah you tried to exit %d\n", i); } "return" is DEFINED as stopping execution of the FUNCTION that called it and returning control (and a value, if specified) to "whatever" called that function, whether it was another function, or some veiled-from-view system mechanism (as with main() or as an interrupt handler). -- |------------Dan Levy------------| THE OPINIONS EXPRESSED HEREIN ARE MINE ONLY | AT&T Data Systems Group | AND ARE NOT TO BE IMPUTED TO AT&T. | Skokie, Illinois | |-----Path: att!ttbcad!levy-----|