trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: April 2012

Re: [trinity-devel] c/c++ gurus - Help? [ was Re: [trinity-devel] Now kipi-plugins failing?? error: redeclaration of 'TQListViewItemIterator it']

From: "Timothy Pearson" <kb9vqf@...>
Date: Tue, 10 Apr 2012 18:53:39 -0500
> On 04/10/2012 06:32 PM, Darrell Anderson wrote:
>> I won't say for sure, but in commit 21705d1b 2012-04-05 where I cleaned
>> some typos, that effort inadvertently created two identical
>> declarations. The code never failed previously because the typos
>> actually caused two different declarations, one of which was no longer
>> being used. The remaining declaration one was abandoned in place, so to
>> speak, but caused no harm. My typo scrubbing caused the two declarations
>> to become identical. I had to fix that in commit 63df5ccd 2012-04-06.
>>
>> Point being? Let the gurus decide but I think only one of the five
>> declarations is being duplicated, but perhaps the solution is as simple
>> as deleting the explicit declaration in function slotAddImages.
>>
>> Darrell
>
> Any suggested work-around for the time being? I would hate to just blindly
> start
> hacking 'd' -> 'f' or something similar (which is pretty much what I would
> be
> doing). But for someone experienced, it would only take a second or so I'm
> sure.

I think I see the problem, but haven't recompiled to test if this idea
resolves it for sure.

It looks like for whatever reason gcc < 4.7 was't barfing when the new
"it" object was created within the scope of the existing "it" object,
which was created within the for loop definition.  Thus, gcc's new
behaviour is definitely correct.

The easiest fix is to replace all instances of
"TQListViewItemIterator it(d->listView);"
with
"TQListViewItemIterator it2(d->listView);"
or similar.

Tim