Hi, Guys
Unfortunately we don't always want or can use precompiled headers.
Besides,
argument about precompiled headers is double sided sword. Such
precompiled
headers could be also used to enable these warnings after all osg
headers with disabled warnings were included. In my humble opinion this
new policy will cause more problems when more windows developers update
repository.
I have just updated osg from SVN. My application is modular and is build
from twenty something dlls. Most of them use osg. And of course during
compilation of the code under VisualStudio 9.0 I see a tons of OSG
related
warnings (excerpt from compiler output below). On the other hand we don't
use precomiled headers because we want the code to be linux portable.
Sure I
can disable warnings in compiler properties for these projects. But I
think
that this is bad idea to force this every windows OSG application
developer to change all their projects.
In my opinion this problem should be fixed at OSG level - compilation of
OSG headers should not produce warnings (at least not such number) even
if
this is actually VisualStudio problem. I also agree that disabling these
warnings permanently in osg/Export was also controversial as it
suppressed
them in user applications. But in former version we did not see bogus
VisualStudio warnings and those who wanted them could enable them again.
This time we all will see them and will have to change their existing
projects.
It looks like only good solution could be wrapping osg classes with
pragma
push/pop disabling warnings only when these classes are built. But here I
expect that Robert will object and say again that fixes for over
sensitive
compiler warnings could actually bring some errors.
Some middle step solution could be CMake define which would activate
warning
disable in osg\Export. Would this be acceptable ?
What do other OSG windows developers think ?
Cheers,
Wojtek Lewandowski
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/BufferObject(374) : warning
C4251: 'osg::PixelBufferObject::_bufferEntryImagePair' : struct
'std::pair<_Ty1,_Ty2>' needs to have dll-interface to be used by clients
of
class 'osg::PixelBufferObject'
24> with
24> [
24> _Ty1=osg::BufferObject::BufferEntry,
24> _Ty2=osg::Image *
24> ]
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Array(169) : warning C4251:
'osg::Array::_vbo' : class 'osg::ref_ptr<T>' needs to have dll-interface
to
be used by clients of class 'osg::Array'
24> with
24> [
24> T=osg::VertexBufferObject
24> ]
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Quat(366) : warning C4244:
'argument' : conversion from 'const osg::Quat::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Quat(366) : warning C4244:
'argument' : conversion from 'const osg::Quat::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Quat(366) : warning C4244:
'argument' : conversion from 'const osg::Quat::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Quat(369) : warning C4244:
'argument' : conversion from 'const osg::Quat::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(585) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(585) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(585) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(601) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(601) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(601) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec3f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(617) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(617) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(617) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(617) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(632) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(632) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
24>C:\dev\OSG_SVN\OpenSceneGraph\include\osg/Matrixd(632) : warning
C4244:
'argument' : conversion from 'const osg::Matrixd::value_type' to
'osg::Vec4f::value_type', possible loss of data
----- Original Message -----
From: Simon Hammett
To: OpenSceneGraph Users
Sent: Friday, November 07, 2008 5:35 PM
Subject: Re: [osg-users] pragma warnings disabled in headers
2008/11/7 Robert Osfield <[EMAIL PROTECTED]>
On Fri, Nov 7, 2008 at 3:42 PM, Simon Hammett
<[EMAIL PROTECTED]> wrote:
> I agree with Peter, arbitrarily turning off peoples warnings isn't
> good
> practice.
The OSG generally doesn't disable warnings, warning disabling is only
done on VS as it's had a history of producing lots of warnings on
correct code.
It's a number of years since I've used Windows. I do occassionally up
the warning levels on the OSG via's our Cmake's options for this, this
can help you spot some useful mistakes, but it also flags lots of
warnings that mislead more than they inform so you have to enable them
with an eye to what the warnings really mean - I do occassionally see
"fixes" to warnings that while well meaning actually break code.
If it's possible to get VS to disable warnings via compiler options
rather than in source #pragma then this would be the best solution,
it's what we have under gcc.
It is possible to disable via the command line.
I'll have a look into modifying the cmake stuff,
I've got a couple of things to submit as well, so
I'll post to submissions once I'm done.
--
The truth is out there. Usually in header files.
________________________________
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org