[comp.sys.encore] cpp problem?

dcourte@eve.wright.edu (Dale Emery Courte) (10/04/89)

I am trying to make X11R3 on our Multimax, under Umax 4.2 (3.3.0), and I
seem to have run into a preprocessor bug. While compiling
./util/makedepend/main.c, I get the following:

"main.orig.c", line 65: Preprocessor expression must be constant
"main.orig.c", line 206: Preprocessor expression must be constant
"main.orig.c", line 428: Preprocessor expression must be constant

These lines are each identical and look like this:

#if defined (mips) && defined (SYSTYPE_SYSV)

After experimentation and examination, I discovered the following
culprit in util/makedepend/def.h:

struct symtab		*defined();

This definition of 'defined' is apparently throwing the preprocessor
off, though obvoiuosly this must be peculiar to the multimax, as the
def.h, and all other sources came directly from an X11R3 distribution
tape.

Am I crazy, or is this a bug? Has anyone else encountered it? Is there
some way, like some fancy quoting or escape characters, to get around
this problem? For now I am fiddling with source code, which is far from
desirable in anything as large as X.

Any help would be welcome. Thanks in advance.

-----------------------------       -------------------------------------
Dale Courte                         CSNET: dcourte@eve.wright.edu
University Computing Services       BITNET: dcourte@wsu
Wright State University             UUCP: ..!uunet!ncrlink!wright!dcourte
Dayton, Ohio 45435                  phone: (513) 873-4030
-----------------------------       -------------------------------------

lundy@pinocchio.Encore.COM (Joe Lundy) (10/04/89)

In article <722@thor.wright.EDU	 dcourte@eve.UUCP (Dale Emery Courte) writes:
	
	I am trying to make X11R3 on our Multimax, under Umax 4.2 (3.3.0), and I
	seem to have run into a preprocessor bug. While compiling
	./util/makedepend/main.c, I get the following:
	
	"main.orig.c", line 65: Preprocessor expression must be constant
	"main.orig.c", line 206: Preprocessor expression must be constant
	"main.orig.c", line 428: Preprocessor expression must be constant
	
	These lines are each identical and look like this:
	
	#if defined (mips) && defined (SYSTYPE_SYSV)
	
	After experimentation and examination, I discovered the following
	culprit in util/makedepend/def.h:
	
	struct symtab		*defined();
	
	This definition of 'defined' is apparently throwing the preprocessor
	off, though obvoiuosly this must be peculiar to the multimax, as the
	def.h, and all other sources came directly from an X11R3 distribution
	tape.
	
	Am I crazy, or is this a bug? Has anyone else encountered it? Is there
	some way, like some fancy quoting or escape characters, to get around
	this problem? For now I am fiddling with source code, which is far from
	desirable in anything as large as X.
	
	Any help would be welcome. Thanks in advance.

You're not crazy.

This was a bug originally found at Mitre and one other site that I can't
recall on the same day.  There is a fix for this in the 3.3 update and 
should be corrected in 4.0 as well.  In the meantime, try not to use the name
'defined' as a variable, structure, etc., when using #if defined() ...

__________________________________________________________________
Joe Lundy		lundy@Encore.COM
Encore Computer		{bu-cs,decvax,necntc,talcott}!encore!lundy
Marlborough, Mass.


	-----------------------------       -------------------------------------
	Dale Courte                         CSNET: dcourte@eve.wright.edu
	University Computing Services       BITNET: dcourte@wsu
	Wright State University             UUCP: ..!uunet!ncrlink!wright!dcourte
	Dayton, Ohio 45435                  phone: (513) 873-4030
	-----------------------------       -------------------------------------