[SERVER-1578] Compilation failed on Gentoo GCC-4.4 Created: 06/Aug/10  Updated: 12/Jul/16  Resolved: 11/Aug/10

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 1.6.0
Fix Version/s: 1.6.1, 1.7.0

Type: Bug Priority: Major - P3
Reporter: Maxim Penzin Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Gentoo Linux, gcc (Gentoo 4.4.3-r2 p1.2) 4.4.3, glibc 2.11.2


Attachments: File log.diff    
Operating System: Linux
Participants:

 Description   

/mongodb-src-r1.6.0: scons .

scons: Reading SConscript files ...
scons version: 1.3.0.d20100501
python version: 2 6 5 'final' 0
Checking whether the C++ compiler works(cached) yes
Checking for C library stdc++... (cached) yes
Checking for C++ header file pcrecpp.h... (cached) yes
Checking for C++ header file boost/filesystem/operations.hpp... (cached) yes
Checking for C library boost_system-mt... (cached) yes
Checking for C library boost_thread-mt... (cached) yes
Checking for C library boost_filesystem-mt... (cached) yes
Checking for C library boost_program_options-mt... (cached) yes
Checking for C++ header file execinfo.h... (cached) yes
Checking for C library pcrecpp... (cached) yes
Checking for C library pcre... (cached) yes
Checking for C library pcap... (cached) yes
Checking for C library mozjs... (cached) no
Checking for C library js... (cached) yes
Checking for C header file js/jsapi.h... (cached) yes
Checking whether the C++ compiler works(cached) yes
Checking for C++ header file boost/filesystem/operations.hpp... (cached) yes
Checking for C library boost_system-mt... (cached) yes
Checking for C library boost_thread-mt... (cached) yes
Checking for C library boost_filesystem-mt... (cached) yes
Checking for C library boost_program_options-mt... (cached) yes
Checking for C++ header file execinfo.h... (cached) yes
Checking for C library pcap... (cached) yes
Checking for C library mozjs... (cached) no
Checking for C library js... (cached) yes
Checking for C header file js/jsapi.h... (cached) yes
Checking for C library readline... (cached) yes
Checking for C library ncurses... (cached) yes
Checking for C library tinfo... (cached) no
Checking for C library rt... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o client/examples/authTest.o -c -Wnon-virtual-dtor -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -DXP_UNIX -I. -I/home/maxp/in client/examples/authTest.cpp
cc1plus: warnings being treated as errors
In file included from ./client/../pch.h:150,
from ./client/dbclient.h:20,
from client/examples/authTest.cpp:20:
./client/../util/log.h: In static member function 'static void mongo::Logstream::logLockless(const mongo::StringData&)':
./client/../util/log.h:163: error: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
./client/../util/log.h: In member function 'virtual void mongo::Logstream::flush(mongo::Tee*)':
./client/../util/log.h:219: error: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
scons: *** [client/examples/authTest.o] Error 1
scons: building terminated because of errors.



 Comments   
Comment by auto [ 11/Aug/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: check return from fwrite SERVER-1578
http://github.com/mongodb/mongo/commit/af35eebfb65fc2754a8e5b2236a370857125f414

Comment by auto [ 11/Aug/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: check return from fwrite SERVER-1578
http://github.com/mongodb/mongo/commit/89ae78967d3b94369b71977af48d33d89e9b7dd9

Comment by Benoit Larroque [ 11/Aug/10 ]

Here is a diff file that corrected the issue on my computer (affects only util/log.h)

Comment by Benoit Larroque [ 11/Aug/10 ]

The exact same error happens with gcc 4.3.4

$ g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/configure -prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g+-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --disable-libgcj --with-arch=i686 --enable-languages=c,c+,treelang,fortran --enable-shared --enable-threads=posix --enable__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.4 p1.1, pie-10.1.5'
Thread model: posix
gcc version 4.3.4 (Gentoo 4.3.4 p1.1, pie-10.1.5)

g++ -o client/examples/authTest.o -c -Wnon-virtual-dtor -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -DXP_UNIX -I. -I/versatile client/examples/authTest.cpp
cc1plus: warnings being treated as errors
In file included from ./client/../pch.h:150,
from ./client/dbclient.h:20,
from client/examples/authTest.cpp:20:
./client/../util/log.h: In static member function 'static void mongo::Logstream::logLockless(const mongo::StringData&)':
./client/../util/log.h:163: error: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
./client/../util/log.h: In member function 'virtual void mongo::Logstream::flush(mongo::Tee*)':
./client/../util/log.h:219: error: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result

Generated at Thu Feb 08 02:57:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.