This one bit me today

David Goodenough dg at lakart.UUCP
Tue Oct 10 02:34:10 AEST 1989


davidsen at crdos1.crd.ge.COM (Wm E Davidsen Jr) sez:
>   It pops up in macros from time to time. Consider:
> 	#define xavg(m) (sum+3)/m

If you don't write that as:

 	#define xavg(m) (sum+3)/(m)

you deserve what you get ....... let's see

	xavg(i+5);

-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com			  +---+



More information about the Comp.lang.c mailing list