On Thu, 2013-10-17 at 11:20 +0600, Ildar Mulyukov wrote:
16.10.2013 18:21, Patrick Ohly пишет:
> Can you try working around this by replacing "keys[i]" with
"keys.at(i)"
> in the surrounding code of EvolutionSyncSource.cpp?
Yes! it worked. Thanks a lot!
> I must have had problems like that myself when writing the code, because
> the commit message for PlainGStrArray says:
>
> glib: smart pointer for glib string arrays
>
> Automatically calls g_strfreev(). Accessing entries in the array must
> be done with at(), overloading the [] operator led to a "operator
> ambiguous" warning from gcc on Debian Stable in x86.
>
> But I did not document why overloading was necessary and don't remember
> or see that now. EvolutionSyncSource.cpp ended up using the [] operator
> in that one line you are stumbling over now and not the others, which is
> a bit puzzling.
Yeah, hard to answer..
For the the record, the following two commits are on their way into
master to address the problem:
commit 1260a702f4210f81a8246be0e80d98219f3bfdcd
Author: Patrick Ohly <patrick.ohly(a)intel.com>
Date: Fri Oct 18 09:55:44 2013 +0200
glib: prevent accidental usage of PlainGStrArray []
The array operator happens to work on some platforms, but not others
(see previous commit). Make it private without an implementation to
catch the undesired usage of it on platforms whether the code would
happen to work otherwise.
commit dd61308c67d3d923113cea5c32d2bccff7e46aa7
Author: Patrick Ohly <patrick.ohly(a)intel.com>
Date: Fri Oct 18 09:50:18 2013 +0200
EDS: fix compile problem with boost and EDS > 3.36
This fixes the following problem, seen with Boost 1.53.0 on altlinux
when compiling for EDS >= 3.6:
/usr/include/boost/smart_ptr/shared_ptr.hpp: In instantiation of 'typename
boost::detail::sp_array_access<T>::typ
src/backends/evolution/EvolutionSyncSource.cpp:163:38: required from here
/usr/include/boost/smart_ptr/shared_ptr.hpp:663:22: error: return-statement with a
value, in function returning '
make[2]: ***
[src/backends/evolution/src_backends_evolution_syncecal_la-EvolutionSyncSource.lo]
The "void" type above is wrong, so it looks like a missing type trait
for the pointer type used in the smart_ptr. PlainGStrArray already had
an at() method to work around such issues, so use it. Not sure why this
one usage of [] slipped through.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.