Menu

#4 Serious GCC warning: no return

v1.0_(example)
closed-fixed
None
5
2013-06-15
2013-06-15
Lazy_Kent
No

I compile cxxtools for openSUSE.

Post-build check shows an error in the code and I can't build a package:

... testing for serious compiler warnings
(using /usr/lib/build/checks-data/check_gcc_output)
(using /home/kent/rpmbuild/BUILD-osc/openSUSE_Factory-x86_64/.build.log)

I: Program returns random data in a function
E: cxxtools no-return-in-nonvoid-function iconvstream.cpp:73

From compile log:

/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../src -I../include -I../include -Wno-long-long -Wall -pedantic -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -c -o iconvstream.lo iconvstream.cpp
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../src -I../include -I../include -Wno-long-long -Wall -pedantic -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -c -o atomicity.gcc.x86_64.lo atomicity.gcc.x86_64.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../src -I../include -I../include -Wno-long-long -Wall -pedantic -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -c iconvstream.cpp -fPIC -DPIC -o .libs/iconvstream.o
iconvstream.cpp: In member function 'cxxtools::iconvstreambuf cxxtools::iconvstreambuf::open(std::ostream&, const char, const char*)':
iconvstream.cpp:73:1: warning: no return statement in function returning non-void [-Wreturn-type]

Can you help please with a patch? Thanks.

Discussion

  • Tommi Mäkitalo

    Tommi Mäkitalo - 2013-06-15

    Here is a patch. Thanks for reporting.

     
  • Tommi Mäkitalo

    Tommi Mäkitalo - 2013-06-15
    • status: open --> closed-fixed
    • assigned_to: Tommi Mäkitalo
     

Log in to post a comment.

MongoDB Logo MongoDB