On Friday 10 October 2003 00:50, Art Haas wrote:
> Hi.
>
> This _very_ ugly patch fixes a build issue with GCC-3.4. The new
> compiler complains about the variables 'c' and 'comp' - these two
> variables are protected in the _Base parent class.

This is very strange.  This seems like a gcc-3.4 bug to me.  I don't see 
why we would have to specify the scope when accessing protected 
variables in a subclass (regardless of the inheritance access).  I will 
look through the C++ book and see if anything indicates what is correct 
behavior.

> The patch "fixes" this problem by explicitly listing these variables
> as part of _Base. I say fixes with the quotes because this approach
> relies on these variables never being renamed in the libstdc headers,
> so this fix is really little more than a workaround.

We already rely on the variable names being the same in all possible stl 
implementations (which thankfully holds true for those I have 
encountered).

> I've been having horrible luck with the CVS repo, so what I'm posting
> below is the my snippet of changed code in the lib/Timer.hh file.

Indeed... developer access works like a charm... anonymous CVS 
doesn't...

> Change the code from this ...
[snip]
>
> With this change blackbox compiles with GCC-3.4.
>
> A less hackish solution would probably do something like make a
> temporary priority queue, then pull the values out of the _Base
> priority queue and stick them in the temporary one if it (the freshly
> removed queue object) does not equal "value", then once _Base is
> empty fill it back up with the objects in our temporary priority
> queue. As my C++ skills are limited I'm not sure how to code this, or
> if there is a better approach.

I don't quite understand what you are suggesting :)  So far, the 
priority queue works with several compilers and stl implementations, 
and I don't see the point in changing it (if it ain't broke, don't fix 
it).  However, I didn't write the priority queue stuff, shaleh did, so 
I'll let him comment on this at his discretion.

> There is a filed bug report this patch addresses - bug number 793732.
>
> I've compiled blackbox with this patch, but I'm not running it just
> yet. I'd be interested in hearing if older GCC versions accept this
> code as well.

Just an FYI, but your patch does indeed compile with older versions of 
gcc and with the Intel C++ compiler (using STLport on FreeBSD).  I'm 
not sure how we should deal with this particular problem... thankfully 
it's a relatively easy fix :)

> Art Haas
>
> --
> Man once surrendering his reason, has no remaining guard against
> absurdities the most monstrous, and like a ship without rudder, is
> the sport of every wind.
>
> -Thomas Jefferson to James Smith, 1822

-- 
Bradley T. Hughes - bhughes at trolltech.com
Trolltech AS - Waldemar Thranes gt. 98 N-0175 Oslo, Norway


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
List archives:  http://asgardsrealm.net/lurker/splash/index.html
Trouble? Contact [EMAIL PROTECTED]

Reply via email to