Bug#302989: optimizer breaks function inlining
Package: g++-4.0
Version: 4.0-0pre5
Severity: normal
Hi,
The following test code (atof.cc) elicits no warning when compiled with
g++-4.0 -c -Wall atof.cc
but with optimization GCC complains about the standard library
function atof():
steve@riemann{test}g++-4.0 -c -Wall -O atof.cc
atof.cc: In member function 'double A::foo()':
atof.cc:15: warning: control may reach end of non-void function 'double atof(const char*)' being inlined
/usr/include/stdlib.h:378: warning: control may reach end of non-void function 'double strtod(const char*, char**)' being inlined
----------------------- atof.cc -----------------------------------
#include <cstdlib>
class A
{
public:
double foo();
private:
};
double A::foo()
{
return std::atof( "1.2" );
}
----------------------- atof.cc -----------------------------------
Regards,
-Steve
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages g++-4.0 depends on:
ii gcc-4.0 4.0-0pre5 The GNU C compiler
ii gcc-4.0-base 4.0-0pre5 The GNU Compiler Collection (base
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
ii libstdc++6-4.0-dev 4.0-0pre5 The GNU Standard C++ Library v3 (d
-- no debconf information
Reply to: