[sword-devel] GCC warnings (was: Re: 1.6.1 outstanding items? )

Jonathan Marsden jmarsden at fastmail.fm
Thu Dec 3 21:50:52 MST 2009


Deji Akingunola wrote:

>>       g++ | 4:4.3.3-1ubuntu1 |        jaunty | amd64, i386
>>       g++ | 4:4.4.1-1ubuntu2 |        karmic | amd64, i386

> Those are actually 4.3.3 and 4.4.1 which are older than Fedora's
> 4.4.2. There is no gcc-4.4.3 yet.

Thanks.  I somehow read the colons as periods.  My mistake.

However, the warnings remain an issue for me, in the Debian/Ubuntu
package building environment.  I just now tried to create a test package
using SWORD r2480 with none of my patches except the 02_libver one... it
fails because of a warning.  Build log of this first attempt is at

  http://crosswire.org/~jmarsden/sword/sword-r2480-buildlog.txt

The end of it shows the warning:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../include -I../include
 -I/usr/include -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__
 -DSWICU_DATA=\"/usr/lib/sword/1.6.0_icu_4.0.1\" -D_FTPLIB_NO_COMPAT
 -D_ICU_ -g3 -O0 -Wall -Werror -D_ICU_ -ftemplate-depth-25
 -DCURLAVAILABLE -I/usr/include -I/usr/lib64 -DUSELUCENE -g -O2 -g -Wall
 -DUSBINARY -c ../src/mgr/filemgr.cpp  -fPIC -DPIC -o .libs/filemgr.o
cc1plus: warnings being treated as errors
../src/mgr/filemgr.cpp: In member function ‘signed char
sword::FileMgr::trunc(sword::FileDesc*)’:
 ../src/mgr/filemgr.cpp:285: error: ignoring return value of ‘ssize_t
 write(int, const void*, size_t)’, declared with attribute
 warn_unused_result
 ../src/mgr/filemgr.cpp: In static member function ‘static int
 sword::FileMgr::copyFile(const char*, const char*)’:
 ../src/mgr/filemgr.cpp:418: error: ignoring return value of ‘ssize_t
 write(int, const void*, size_t)’, declared with attribute
 warn_unused_result
make[2]: *** [filemgr.lo] Error 1

BOTTOM LINE: Compiling with -Wall -Werror means that we really do need
to check the return values of write() calls... at least, I think that's
what the issue is.

Jonathan



More information about the sword-devel mailing list