Problem with strange macro definition

Jay M. Libove root at libove.UUCP
Sun Jan 22 03:13:39 AEST 1989


System: SCO Xenix 286 v2.2.1 (roughly System V release 2 Unix) on a
PCs Limited 286 box; SCO Xenix 286 v2.2.1 development system as well.

I am trying to build a huge software package that includes something
like this:

#define awful_macro(nnnn) \
 if (x_/**/nnnn > y_/**/nnnn) z_/**/nnnn = 0

Which causes the SCO compiler to generate errors claiming that
x_nnnn y_nnnn and z_nnnn are undefined variables in the source module.

I know that it is a long standing and not-likely-to-be-corrected bug
in the generic 'pcc' compiler that makes x_/**/nnnn evaluate to x_nnnn
instead of the x_ nnnn that the language definition calls for it to be,
and I can only assume that the authors of this gross code intended for
macro substitution to take place on the nnnn part, achieving the effect
of passing multiple variables via one name... but anyway it certainly
doesn't work.

Can someone suggest what to do to get around this?

Thanks in advance!
-- 
Jay Libove		ARPA:	jl42 at andrew.cmu.edu or libove at cs.cmu.edu
5731 Centre Ave, Apt 3	BITnet:	jl42 at andrew or jl42 at drycas
Pittsburgh, PA 15206	UUCP:	uunet!nfsun!libove!libove or
(412) 362-8983		UUCP:	psuvax1!pitt!darth!libove!libove



More information about the Comp.lang.c mailing list