27 May 2011 15:04
[PATCH] fix warning (treated as error) in check for const overload
Michael Haubenwallner <haubi <at> gentoo.org>
2011-05-27 13:04:47 GMT
2011-05-27 13:04:47 GMT
Hello! While the check 'for const overload' should give "yes" for recent gcc, it does give "no" due to a warning in the check-code and -Werror being set. Attached is a patch to fix this warning. The lines found in config.log: > configure:12893: checking for const overload > configure:12926: x86_64-pc-linux-gnu-g++ -c -Werror -Wall -Wwrite-strings -pthread -O2 -pipe -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -DQT_SHARED -DQT3_SUPPORT -I/usr/include/qt4 -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtSql conftest.cpp >&5 > configure: In function 'void foo(S&, const S&)': > configure:12918:10: error: variable 'i' set but not used [-Werror=unused-but-set-variable] > cc1plus: all warnings being treated as errors > > configure:12929: $? = 1 > configure:12949: result: no As a result, compilation with gcc-4.6.0 fails this way: > x86_64-pc-linux-gnu-g++ -I../include -Wall -Wwrite-strings -pthread -O2 -pipe -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -DQT_SHARED -DQT3_SUPPORT -I/usr/include/qt4 -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtSql -DPIC -fPIC -c poa_impl.cc -o poa_impl.pic.o > poa_impl.cc: In constructor 'MICOPOA::POA_impl::POA_impl(const char*, PortableServer::POAManager_ptr, const PolicyList&, MICOPOA::POA_impl*, CORBA::ORB_ptr)': > poa_impl.cc:1955:80: error: passing 'const ObjVar<CORBA::Policy>' as 'this' argument of(Continue reading)
RSS Feed