This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/7311: inline functions do not give control reaches end of non-void functionin g++
- From: Bas Wijnen <shevek at fmf dot nl>
- To: gcc-gnats at gcc dot gnu dot org, <debian-gcc at lists dot debian dot org>
- Date: Mon, 15 Jul 2002 14:30:26 +0200 (CEST)
- Subject: c++/7311: inline functions do not give control reaches end of non-void functionin g++
>Number: 7311
>Category: c++
>Synopsis: inline functions do not give control reaches end of
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Mon Jul 15 05:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Bas Wijnen
>Release: 3.0.4 (Debian testing/unstable)
>Organization:
>Environment:
System: Linux termpje 2.4.18 #14 Fri Jun 21 13:06:58 CEST 2002 i686
unknown
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,proto,obj
c --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared
--with
-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls
--witho
ut-included-gettext --disable-checking --enable-threads=posix
--enable-java-gc=b
oehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
When defining a function inline in a class and no returnvalue is given,
while
it should not be void, there is no warning, not even with -Wall.
>How-To-Repeat:
compile this:
class foo
{
public:
int bar ()
{
}
};
int main ()
{
foo f;
f.bar ();
return 0;
}
with g++ -Wall -Wshadow -ansi -O5 -ggdb3 bug.cc
and see no warnings
>Fix:
a workaround obviously is to give a returnvalue. However finding such an
error is not easy without the warning, especially because it is expected.
>Release-Note:
>Audit-Trail:
>Unformatted:
non-void fun
ction in g++