This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.95.2: inlining of operator<< causes SIGSEGV with -O1
- To: vonbrand at inf dot utfsm dot cl
- Subject: Re: g++ 2.95.2: inlining of operator<< causes SIGSEGV with -O1
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 14 Dec 1999 00:43:21 +0100
- CC: bug-gcc at gnu dot org
- References: <199912131312.KAA18745@pincoya.inf.utfsm.cl>
> > Thanks for your bug report. It's not a bug in g++, but one in your
> > program.
> >
> > > inline ostream& operator<<(ostream& o, const A& a) { o << "A"; }
> >
> > Shouldn't this operator *return* something?
>
> Shouldn't gcc complain loudly that the operator doesn't return anything?
It does, when you invoke it with -Wall. Andrew Koenig proposed that it
should do so even without an option, and I proposed a patch to always
produce a warning when there is no return statement at all, and Jason
rejected it, proposing that -Wreturn-type should be always
activated. Nothing further has been done about it so far.
Regards,
Martin