Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!bruce!mmcg From: mmcg@bruce.cs.monash.OZ.AU (Mike McGaughey) Newsgroups: comp.lang.c Subject: Re: Unnecessary parentheses (Was: Help: VAX C problem) Message-ID: <4003@bruce.cs.monash.OZ.AU> Date: 20 Apr 91 06:25:36 GMT References: <4072.27f7215c@iccgcc.decnet.ab.com> <1991Apr1.203600.15721@zoo.toronto.edu> <1#.gqcm@rpi.edu> <3176@oucsace.cs.OHIOU.EDU> <4329.280f017f@iccgcc.decnet.ab.com> Organization: Monash Uni. Computer Science, Australia Lines: 29 browns@iccgcc.decnet.ab.com (Stan Brown) writes: >In article <3176@oucsace.cs.OHIOU.EDU>, sadkins@oucsace.cs.OHIOU.EDU (Scott W. Adkins) writes: >> When I learned C, I was taught that parens were unecessary, but it was >> highly recommended to use them for the same reason parens were to be used >> with macros (i.e. #define). I have used them ever since and have grown >> quite attached to them. Anymore, the program just would not look right >> if I leave the parens out. Oh well :-) >I'm afraid I don't see the analogy. >You use parens around an expression in a macro because you don't know >the context of the invocation of the macro. The expression in the >return statement has no such problem. Oh, the point is just that if you stick to return(val) it makes it much simpler to #define return to be a macro, if you should ever have to do so (for instance, in printing a trace). Not that that's terribly useful, with a decent debugger. Mike. -- Mike McGaughey AARNET: mmcg@bruce.cs.monash.oz.au "His state is kingly; thousands at his bidding speed, And post o'er land and ocean without rest." - Milton.