This is the mail archive of the gcc-bugs@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: Undefined return type (mis-)reported as fatal error


> g++ 2.95.2 on Intel Solaris 2.6 (but the bug isn't platform dependent).

Thanks for your bug report. It sure is platform-dependent.

> Try compiling code which declares funtions without explicit return
> types. In the old C style, these functions implicitly return int.
> E.G. try compiling Xlib.h. 

Please have a look at http://gcc.gnu.org/cgi-bin/fom.cgi?file=25

> Normally g++ has command line flags -Wreturn-type or -pendantic which
> enable a warning message about the missing return type. In 2.95.2 this
> message is reported without the command line flags as a fatal error.

Well, it is a fatal error. It is ill-formed C++. It was deprecated in
C, hence the warning. It was ill-formed in C++ all the time, and g++
should have never been that permissive with it - it only led to Sun
not fixing their headers. It even is ill-formed in C today.

> This makes compiling X11 programs a tad difficult.

That is primarily a problem of the header files, and not of
g++. Please complain to Sun.

> I believe the error is in grokdeclarator in gcc/cp/decl.c near line 9835.

Did you try your fix? /usr/openwin/include is not a system header...

Regards,
Martin

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