This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined return type (mis-)reported as fatal error
- To: rgreen at etnus dot com
- Subject: Re: Undefined return type (mis-)reported as fatal error
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 30 Mar 2000 06:41:58 +0200
- CC: gcc-bugs at gcc dot gnu dot org, rgreen at etnus dot com, jdelsign at etnus dot com
- References: <38E2C5C2.C8BBCEDA@etnus.com>
> 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