Michael Haubenwallner | 27 May 2011 15:04
Picon
Favicon

[PATCH] fix warning (treated as error) in check for const overload

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)

Karel Gardas | 2 Jun 2011 21:50
Favicon

Re: [PATCH] fix warning (treated as error) in check for const overload


Thanks! Merged into my tree,

Karel

On 05/27/11 03:04 PM, Michael Haubenwallner wrote:
> 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
(Continue reading)


Gmane