[gnu.emacs.bug] Can't use gcc-cpp to build emacs

warsaw@cme.nbs.gov (Barry A. Warsaw) (03/29/89)

I'm cross posting this to both gnu.gcc.bug and gnu.emacs.bug because,
although I think the bug is in cpp, the fix might be in the emacs
source file...

System background:
	Sun 3/280 OS 3.5
	gcc version 1.34
	emacs version 18.53

I've gotten gcc up and running and I'm now trying to rebuild emacs
using gcc but I'm running into some problems, mostly associated with
gcc-cpp, the gnu C preprocessor.  First, I had problems with gcc-cpp
barfing on various /usr/include files so I ran the fixincludes script
as suggested and compiled emacs with the -ftraditional switch but it
appears as though fixincludes doesn't catch the non-ANSI-ness of
/usr/include/pixrect/{traprop.h, pixrect_hs.h}, so I had to patch these
two files by hand (thanks to Warren Jasper for pointing this out).

Now with the newly patched include files, I tried recompiling emacs
and most of the compilation went successfully, until it got to
.../emacs/src/sunfns.c.  At this point I got the following errors:

----------------------------------------------------------------------
gcc -ftraditional -O -Demacs    -c sunfns.c
sunfns.c:75: parse error before `_data'
sunfns.c:75: initializer for scalar variable requires one element
sunfns.c:75: parse error before `_data'
sunfns.c:84: parse error before `_data'
sunfns.c:84: redefinition of `_data'
sunfns.c:75: here is the previous declaration of `_data'
sunfns.c:84: initializer for scalar variable requires one element
sunfns.c:84: parse error before `_data'
*** Error code 1

Stop.
*** Error code 1

Stop.
----------------------------------------------------------------------

Here are the two lines (75 and 84) in sunfns.c:

75: static mpr_static(CursorMpr, 16, 16, 1, CursorData);
84: static mpr_static(ArrowCursorMpr, 16, 16, 1, ArrowCursorData);

So *now* I tried replacing gcc-cpp with a pointer to /bin/cpp (also as
suggested in the gcc install info page) and emacs compiled fully
successfully.  This implies to me that gcc-cpp can't handle the
mpr_static macro due some bogosity in its definition (mpr_static's
that is).  Has anyone else seen this happen and does anyone have a
workaround?

Also I think fixincludes should handle {traprop.h, pixrect_hs.h}.

One other bug (feature?).  Gcc seems to semi-recognize the
-traditional switch.  I get the following error message:

% gcc -traditional hello.c
0: unknown flag -traditional

This is not a fatal error as the program still compiles, but it seems
to produce this bogus warning message.  The following produces no
warnings:

% gcc -ftraditional hello.c

What gives?  Is -traditional misdocumented or a historical holdover
that's been (being?) superceded by -ftraditional?

Thanks in advance.

-Barry

NAME: Barry A. Warsaw                USMAIL: National Institute of Standards
TELE: (301) 975-3460                         and Technology (formerly NBS)
UUCP: {...}!uunet!cme-durer!warsaw           Rm. B-124, Bldg. 220
ARPA: warsaw@cme.nbs.gov                     Gaithersburg, MD 20899
  or: warsaw@cme-durer.arpa