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 'ObjVar<T>::operator T*() [with T = CORBA::Policy]' discards
> qualifiers [-fpermissive]
> poa_impl.cc:1955:80: error: invalid conversion from 'CORBA::Policy*' to
> 'CORBA::Object*' [-fpermissive]
> ../include/mico/security/transportsecurity.h:581:40: error: initializing
> argument 1 of 'static TransportSecurity::ObjectCredentialsPolicy*
> TransportSecurity::ObjectCredentialsPolicy::_narrow(CORBA::Object_ptr)'
> [-fpermissive]
> make[1]: *** [poa_impl.pic.o] Error 1
> make: *** [system] Error 1
With "checking for const overload... yes", compilation with gcc-4.6.0 succeeds.
Thank you!
/haubi/
--
Michael Haubenwallner
Gentoo on a different level
Checking for 'const overload' fails with 'unused variable i',
resulting in build errors (suggesting -fpermissive) with gcc-4.6:
http://bugs.gentoo.org/show_bug.cgi?id=365117
--- aclocal.m4.orig 2011-05-25 14:20:01.626683873 +0200
+++ aclocal.m4 2011-05-25 14:20:43.930773070 +0200
@@ -353,11 +353,12 @@
void bar (const int &, int &, const int *, int *, int *&);
- void foo (S &s, const S &cs)
+ int foo (S &s, const S &cs)
{
- int i = s; i = cs; i = *s; i = *cs;
+ int i = s; int j = cs; int k = *s; int l = *cs;
bar (s, s, s, s, s);
bar (cs, s, cs, s, s);
+ return (i + j + k + l);
}
],
eval "ac_cv_have_const_overload=yes",
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Mico-devel mailing list
Mico-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mico-devel