public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15912] New: No warnings emitted for non-void functions with missing return values
@ 2004-06-10 19:18 jan at etpmod dot phys dot tue dot nl
2004-06-10 19:36 ` [Bug c++/15912] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: jan at etpmod dot phys dot tue dot nl @ 2004-06-10 19:18 UTC (permalink / raw)
To: gcc-bugs
consider:
int f1() {}
template <class T> int f2() {}
struct S {
int f() {}
static int s() {}
};
int main()
{
f1();
f2<int>();
S::s();
S s;
s.s();
return 0;
}
There are two bugs:
1) Compiling this snippet without warning options does not generate warnings
for the missing return values, contrary to the gcc man page which says that
these situations should always be diagnosed (in C++).
2) Compilation with -Wall and/or -Wreturn-type fails to diagnose the problem
in the regular free function f1. The function template, the function member
and the static function in class scope are correctly recognized as
problematic.
--
Summary: No warnings emitted for non-void functions with missing
return values
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jan at etpmod dot phys dot tue dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i586-suse-linux
GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15912
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/15912] No warnings emitted for non-void functions with missing return values
2004-06-10 19:18 [Bug c++/15912] New: No warnings emitted for non-void functions with missing return values jan at etpmod dot phys dot tue dot nl
@ 2004-06-10 19:36 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-10 19:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-10 19:36 -------
For part 1, it looks like you are mis reading what it says, it says that functions without a return-types
are always an error in C++ aka:
f() { return 1;} //ERROR
For part 2, this is a dup of bug 14107, the bug is a known regression from 3.4.0.
So closing this as a dup of bug 14107.
*** This bug has been marked as a duplicate of 14107 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Keywords| |diagnostic, documentation
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15912
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-10 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-10 19:18 [Bug c++/15912] New: No warnings emitted for non-void functions with missing return values jan at etpmod dot phys dot tue dot nl
2004-06-10 19:36 ` [Bug c++/15912] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).