Re: Regression from 3.2 to 3.3
Will Newton <wnewton@cmedltd.com> writes:
> On Tuesday 19 August 2003 14:09, Falk Hueffner wrote:
> > Will Newton <wnewton@cmedltd.com> writes:
> > > A package I maintain (aqsis) no longer builds with gcc 3.3 as the default
> > > compiler. The error given is:
> > >
> > > shaderstack.h: In function `void Aqsis::OpCAST(A&, B&,
> > > Aqsis::IqShaderData*, Aqsis::IqShaderData*, Aqsis::CqBitVector&) [with A
> > > = TqFloat, B = Aqsis::CqColor]':
> > > shadervm1.cpp:277: instantiated from here
> > > shaderstack.h:543: error: invalid static_cast from type `float' to type `
> > > Aqsis::CqColor'
> >
> > What type is Aqsis::CqColor?
>
> A class representing a color, coded as you might expect, as a vector
> of three float values. It doesn't have a (float) constructor but
> this code does compile with gcc 3.2. I'm not sure how it could, but
> my C++ is a bit rusty.
I don't see how, either. I'm pretty sure this was a bug in 3.2. Maybe
it picked up erroneously a conversion via CqVector3D.
I suggest adding a new constructor to CqColor. Or rethinking the
design, constructing a color from a single float value doesn't really
make a lot of sense.
--
Falk
Reply to: