Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!spdcc!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: Unnecessary Macros (was Re: Unnecessary Parenthesis)
Message-ID: <8078@haddock.ima.isc.com>
Date: 26 Sep 88 19:09:34 GMT
References: <2089@ssc-vax.UUCP> <441@kaon.uchicago.edu> <1401@devsys.oakhill.UUCP> <23@datcon.UUCP> <8577@smoke.ARPA>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 15

In article <8577@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn) writes:
>In article <23@datcon.UUCP> sar@datcon.co.uk (Simon A Reap) writes:
>>	z = square(x) + square(y);
>>Does anyone know how to get round this problem?  Please!!
>	z = x*x + y*y;

Doug's answer is certainly a better way to write the given example, but is not
particularly enlightening if you want
	z = square(*p++) + square(getchar());

I dislike the original macro, but the fact remains that there is no good way
to write this in C.  (There are several bad ways, and we could argue over
which is the least bad, but it really depends on the circumstances.)

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint