[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

inline functions do not give control reaches end of non-void function in g++



>Submitter-Id:  net
>Originator:    Bas Wijnen
>Organization:  
>Confidential:  no
>Synopsis:      inline functions do not give control reaches end of 
non-void fun
ction in g++
>Severity:      non-critical
>Priority:      low
>Category:      c++
>Class:         accepts-illegal
>Release:       3.0.4 (Debian testing/unstable)
>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.



-- 
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: