[gnu.gcc.bug] Gcc and X11 imake

stoller%morgan@CS.UTAH.EDU (Leigh B. Stoller) (09/23/88)

Hi,
  Here at the University of Utah we recently installed the gcc
compiler suite as the default on our BSD4.3 hp9000's. This caused a
problem in the X11 imake utility, which depends heavily on /lib/cpp.

The problem results from some of the Imakefiles having the following.
(see server/os/4.2bsd/Imakefile)

SpecialObjectRule(osinit.o, $(IRULESRC)/$(MACROFILE), -DADMPATH=\"$(FOO)/foo\")

When this file is run through gcc cpp, it has trouble with \". For example
the results of pcc cpp on:

#define foo(x) =x=
foo(\"$(BAR)/bar\")

is:

# 1 ""


 =\"$(BAR)/bar\"=


while the results of gcc cpp are:

:3: unterminated macro call
:3: only 0 args to macro `foo'
# 1 ""


==


An alternative syntax for the for the Imakefiles could be:

#define foo(x) =x=
foo('"$(BAR)/bar"')

The single quotes produce the same results as escaping the double quotes.


The other solution would be to change gcc cpp to handle this case, as pcc
cpp does.

Either way is fine by me.


Thanks,
Leigh Stoller