c++/3914: gcc3.0 does not complain about missing return statments

georg.ritter@cern.ch georg.ritter@cern.ch
Thu Aug 2 06:58:00 GMT 2001


>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:



More information about the Gcc-bugs mailing list