This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/3914: gcc3.0 does not complain about missing return statments
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/3914: gcc3.0 does not complain about missing return statments
- From: georg dot ritter at cern dot ch
- Date: Thu, 2 Aug 2001 15:41:04 +0200
>Number: 3914
>Category: c++
>Synopsis: gcc 3.0 does not complain about missing return statements in fn's
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Thu Aug 02 06:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Georg Ritter
>Release: 3.0
>Organization:
>Environment:
System: Linux gericom 2.4.3 #12 Thu Apr 5 15:43:48 CEST 2001 i586 unknown
Architecture: i586
host: i586-pc-linux-gnu
build: i586-pc-linux-gnu
target: i586-pc-linux-gnu
configured with: ../configure
>Description:
Accepts fn with return type but missing the return statement.
>How-To-Repeat:
compiles without error:
(in some special cases it crashes in the ~basic_string. Not in this example
works for different return types (checked with int also).
#include <string>
std::string fn()
{
int x=1;
}
int main()
{
fn();
return 0;
}
>Fix:
fix gcc I guess ;-), thanks for taking care of this!
>Release-Note:
>Audit-Trail:
>Unformatted: