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]
Other format: [Raw text]

[Bug c++/11474] -Wreturn-type should default to on when compiling C++


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11474



------- Additional Comments From jsm at polyomino dot org dot uk  2003-07-13 16:51 -------
Subject: Re:  -Wreturn-type should default to on when compiling
 C++

On Sun, 13 Jul 2003, zack at gcc dot gnu dot org wrote:

> I don't think we can reject the program by default in either C or C++,
> but I would support turning the warning on by default in both languages --
> the condition it warns about is guaranteed to be a bug (unless the code
> predates the existence of the 'void' return type, and even then the fix is
> trivial)

The most obvious problematic cases are where control can't reach the end
of the function because of a call to a nonreturning function, but the
maintainer wants to avoid annotations specific to a particular compiler
(in this case, __attribute__((__noreturn__))) in their source code so the
compiler doesn't know that the function is nonreturning.


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