This is the mail archive of the gcc-prs@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]

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



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


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