This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs 19990103 exits with error when hitting function that doesn't declare return type?



> I just installed the 19990103 snapshot of egcs to build my X11/C++ programs
> on a SunOS ox 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-5_10 machine.
> These are (some of) the errors I get:
> 
>   /usr/include/X11/Xlib.h:2411: ANSI C++ forbids declaration `XCopyArea' with no type
....

> egcs is correct: these functions don't have a return type.  Since these
> are system files, it would be nice if I could turn off the warnings.
> Most important, though, egcs needs to not die -- it exits with a 1 after
> hitting this file after generating lots of "forbids declaration"
> messages but nothing else.

Generally speaking, fixincludes is supposed to fix invalid system headers
(the original headers aren't modified, instead fixed copies of headers
are placed where the compiler will see them first).  I suppose the
right thing would be to fix these headers to plug in a return type.
I suspect that these functions should really return void, but the type
would have to be set to int to preserve their behavior.

> Is this a bug in egcs, or is there a backwards compatability option that
> I'm not seeing?

It's a bug in X11R6 (but perhaps there should be a way to get code like
this to compile).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]