BUG: ANSI C++ forbids declaration ... with no type

Piotr Klaban makler@man.torun.pl
Fri Oct 15 02:38:00 GMT 1999


Hi, I have searched the Web and GCC mailing lists
for the solution with no success.
The problem is:
- I could not compile any C++ program that
  includes system header from the X11 directory
  of any Solaris 2.6 / Solaris7 system.

E.g. either with egcs-19991013 or gcc-2.95.1
while compiling plotutils-2.3 (GNU package),
I get the following errors:

gmake[2]: Entering directory `/opt/src/gnu/plotutils/plotutils-2.3/libplotter'
/bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/openwin/include -I./../include -DLIBPLOT -DLIBPLOTTER    -O2 -c apioldcc.cc
rm -f .libs/apioldcc.lo
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/openwin/include -I./../include -DLIBPLOT -DLIBPLOTTER -O2 -c  -fPIC -DPIC apioldcc.cc -o .libs/apioldcc.lo
In file included from ../include/plotter.h:41,
                 from extern.h:44,
                 from apioldcc.cc:19:
/usr/openwin/include/X11/Xlib.h:2063: ANSI C++ forbids declaration of `XSetTransientForHint' with no type
<... more snipped ...>
/usr/openwin/include/X11/Xlib.h:4162: ANSI C++ forbids declaration of `XWindowEvent' with no type
In file included from /usr/openwin/include/X11/Intrinsic.h:57,
                 from ../include/plotter.h:42,
                 from extern.h:44,
                 from apioldcc.cc:19:
/usr/openwin/include/X11/Xutil.h:363: ANSI C++ forbids declaration of `XClipBox' with no type
<... more snipped ...>
/usr/openwin/include/X11/Xutil.h:903: ANSI C++ forbids declaration of `XXorRegion' with no type
In file included from /usr/openwin/include/X11/Intrinsic.h:58,
                 from ../include/plotter.h:42,
                 from extern.h:44,
                 from apioldcc.cc:19:
/usr/openwin/include/X11/Xresource.h:249: ANSI C++ forbids declaration of `XrmQGetResource' with no type
In file included from /usr/openwin/include/X11/SM/SMlib.h:38,
                 from /usr/openwin/include/X11/Shell.h:54,
                 from extern.h:52,
                 from apioldcc.cc:19:
/usr/openwin/include/X11/ICE/ICElib.h:417: ANSI C++ forbids declaration of `IceFlush' with no type
gmake[2]: *** [apioldcc.lo] Error 1

I know that system include files should not generate such errors,
since SUN would not change standard X11 header files.

Best regards,

Piotr Klaban



More information about the Gcc-bugs mailing list