Although we have an old version of OSG compiled on Solaris, we weren't
using it.  Our code had a special ifdef for platforms that we didn't
have working yet.  So I'm adding the Solaris compiler.  That's why we
have the warnings now.

andy


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Friday, August 10, 2007 10:19 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] 64 bit warning

Hi Andy,

Changing to size_t would probably be O.K.

W.r.t compiler with older versions of the OSG, you should really get
almost all the same warnings as before if you are using the same
compiler, things like TemplateArray haven't changed since a long time
before 1.0.

Robert.

On 8/10/07, Andy Skinner <[EMAIL PROTECTED]> wrote:
>
>
>
>
> We're getting warnings on solaris 64 about truncations for methods
that
> return something like vector::size() (which is size_t) using type
unsigned
> int.  For example, TemplateArray::getNumElements():
>
>
>
> unsigned int getNumElements() const { return this->size(); }
>
>
>
>
>
> For regular methods, we may get warnings as we build OSG, but we don't
count
> warnings as errors as we build 3rd party stuff.  We also wrap includes
of
> OSG headers in macros so that we don't get warnings when our code
includes
> them.  This leaks out for things like template instantiation for
things like
> shadowing (a class has a method x(), and a construction with an arg x,
and
> some compilers, when set to be picky, don't like it.)  The case I
mention
> above (truncation as we return size_t as an unsigned int) is also
leaking
> out, because it is in an inline method.
>
>
>
> What do you suggest?  I'm sure this happens a lot.  We could add casts
in
> the methods:
>
>
>
> unsigned int getNumElements() const { return static_cast<unsigned int>
> (this->size()); }
>
>
>
> We could redefine the method to return size_t.
>
>
>
> At the moment, I'm adding all of our files to the warning exception
list.
> But that won't go over well, so I'd rather not.
>
>
>
> We've not been compiling with solaris with the older OSG, so I'm
probably
> going to experience more of this pickiness as I update OSG and get
solaris
> going.
>
>
>
> thanks,
>
> andy
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to