Re: [osg-users] Warning messages VS2012...

2013-06-01 Thread Martin Naylor
Hi Robert,
I will give it a go, the warning message fix submitted and supresses the
messages ok and receive none now.

Thanks all.

Martin




-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: 30 May 2013 18:44
To: OpenSceneGraph Users
Subject: Re: [osg-users] Warning messages VS2012...

Hi Martin,

The warning docs discuss multiple inheritance, but the osgDB::fstream class
just inherits directly from std::fstream so on first doesn't look that
relevant.

I've looked at the implementation of fstream here on Linux and the only
issue I've seen that might be a problem is that open() method isn't virtual
so overriding it locally in osgDB::fstream will only work when calling
osgDB::fstream directly, and not through a pointer to the std::fstream.  I
would have thought this type of issue would generate a different warning
through.

The only reason for the existance of the osgDB::fstream is that it runs
OSGDB_CONVERT_UTF8_FILENAME() on the filename.

Perhaps one could remove osgDB::fstream and provided a convience function
such as:

 osgDB::open(std::fstream fs, const char* filename,std::ios_base::openmode
mode)  {
   fs-open(OSGDB_CONVERT_UTF8_FILENAME(filename), mode);  }

This would require going through the OSG examples that utilize the fstream,
replacing the fs.open(..) with an osgDB::open(fs,..) but this wouldn't be
too much work and would avoid the need for subclassing fstream which doesn't
sit that well with me as it's just done to hide the UTF8 filename
conversion.  I'm not the original author of this code though, perhaps
Michael Platings can dive in to explain the reasoning.

Robert.
___
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


Re: [osg-users] Warning messages VS2012...

2013-05-31 Thread Pjotr Svetachov
Hi,

This is actually an issue with the visual studio 2012 library, see here for an 
explanation: http://connect.microsoft.com/VisualStudio/feedback/details/733720/

Cheers,
Pjotr

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54332#54332





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning messages VS2012...

2013-05-31 Thread Robert Osfield
Hi Pjotr,

On 31 May 2013 08:09, Pjotr Svetachov pjotrsvetac...@gmail.com wrote:
 This is actually an issue with the visual studio 2012 library, see here for 
 an explanation: 
 http://connect.microsoft.com/VisualStudio/feedback/details/733720/

Thanks for the link, explains the tangled mess of hacks that got MS
into a situation where valid code produces irrelevant warnings...
umm sounds like they've been making some great engineering
decisions!

So.. for us we either stop inheriting from fstream etc. or we disable
the warning locally using a #pragma.  We already have a series of
#pragma for windows in include/osg/Export.  We could easily add 4250
to the list of disabled warnings.  I'd rather keep disabling warnings
to the minimum, perhaps a local #pragma that is just set for the
include/osgDB/fstream header.  Can we push/pop #pragma's under
Windows?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning messages VS2012...

2013-05-31 Thread Sebastian Messerschmidt

Hi Robert,

Hi Pjotr,

On 31 May 2013 08:09, Pjotr Svetachov pjotrsvetac...@gmail.com wrote:

This is actually an issue with the visual studio 2012 library, see here for an 
explanation: http://connect.microsoft.com/VisualStudio/feedback/details/733720/

Thanks for the link, explains the tangled mess of hacks that got MS
into a situation where valid code produces irrelevant warnings...
umm sounds like they've been making some great engineering
decisions!

So.. for us we either stop inheriting from fstream etc. or we disable
the warning locally using a #pragma.  We already have a series of
#pragma for windows in include/osg/Export.  We could easily add 4250
to the list of disabled warnings.  I'd rather keep disabling warnings
to the minimum, perhaps a local #pragma that is just set for the
include/osgDB/fstream header.  Can we push/pop #pragma's under
Windows?

Yes you can. But this might not help in all cases. At least we can try:

#ifdef _MSC_VER
#pragma warning( push)


#pragma warning( disable : 4250)


#pragma warning( pop )
#endif

Also please note, that there are non-suppressible warnings in VS.

cheers
Sebastian


Robert.
___
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


Re: [osg-users] Warning messages VS2012...

2013-05-31 Thread Laurens Voerman


On 5/31/2013 10:40 AM, Sebastian Messerschmidt wrote:

Hi Robert,

Hi Pjotr,

On 31 May 2013 08:09, Pjotr Svetachov pjotrsvetac...@gmail.com wrote:
This is actually an issue with the visual studio 2012 library, see 
here for an explanation: 
http://connect.microsoft.com/VisualStudio/feedback/details/733720/

Thanks for the link, explains the tangled mess of hacks that got MS
into a situation where valid code produces irrelevant warnings...
umm sounds like they've been making some great engineering
decisions!

So.. for us we either stop inheriting from fstream etc. or we disable
the warning locally using a #pragma.  We already have a series of
#pragma for windows in include/osg/Export.  We could easily add 4250
to the list of disabled warnings.  I'd rather keep disabling warnings
to the minimum, perhaps a local #pragma that is just set for the
include/osgDB/fstream header.  Can we push/pop #pragma's under
Windows?
Robert.

Yes you can. But this might not help in all cases. At least we can try:

#ifdef _MSC_VER
#pragma warning( push)


#pragma warning( disable : 4250)


#pragma warning( pop )
#endif

Also please note, that there are non-suppressible warnings in VS.

cheers
Sebastian

Hi all,
I gave that a try, but that did not remove all of the C4250 warnings, 
although I think the number of warnings was reduced.
so I submitted a modified CMakelist.txt disabling the warning on the top 
level.


Regards, Laurens.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning messages VS2012...

2013-05-31 Thread Robert Osfield
Hi Laurens,

On 31 May 2013 10:33, Laurens Voerman l.voer...@rug.nl wrote:
 I gave that a try, but that did not remove all of the C4250 warnings,
 although I think the number of warnings was reduced.
 so I submitted a modified CMakelist.txt disabling the warning on the top
 level.

Might some of these warnings be valid?

We do have lots of other compilers with good warning generation we can
rely upon so it possibility isn't too critical using a sledge hammer
to squash warnings under Windows but as an general principle I prefer
not to suppress warnings.

With suppressing warnings there are the several approach of embedding
in headers, either globally like done with include/osg/Export, or
locally such as using the rather verbose push/pop pragmas in the
headers, or via CMake and it's setting compiler options for disabling
the warnings for the build of the OSG itself.

Using headers stops warnings being generated in end user applications
as well as the OSG, while the CMake approach only affects the OSG
build.  What is the communities feel seeing warnings in the OSG and
their own applications?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Warning messages VS2012...

2013-05-30 Thread Martin Naylor
Hi all,

I am receiving a huge quantity of warnings when compiling OSG and VPB, they
are both the same thing.

Warning   27   warning C4250: 'osgDB::fstream' :
inherits
'std::basic_istream_Elem,_Traits::std::basic_istream_Elem,_Traits::_Add_
vtordisp1' via dominance
H:\Coding\OSG\OpenSceneGraph\include\osgDB\fstream 41   1
vpb

 

The message is a warning and I cannot see any problem with it apart from its
annoying!

Here is the article on the warning:
http://msdn.microsoft.com/en-us/library/6b3sy7ae(v=vs.80).aspx

 

Could this be fixed in code or do we need to add a pragma to supress the
warning, I cannot seem to find any explicity defined pragma's in the code
for windows?

 

Thanks

 

Martin

 

 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning messages VS2012...

2013-05-30 Thread Robert Osfield
Hi Martin,

The warning docs discuss multiple inheritance, but the osgDB::fstream
class just inherits directly from std::fstream so on first doesn't
look that relevant.

I've looked at the implementation of fstream here on Linux and the
only issue I've seen that might be a problem is that open() method
isn't virtual so overriding it locally in osgDB::fstream will only
work when calling osgDB::fstream directly, and not through a pointer
to the std::fstream.  I would have thought this type of issue would
generate a different warning through.

The only reason for the existance of the osgDB::fstream is that it
runs OSGDB_CONVERT_UTF8_FILENAME() on the filename.

Perhaps one could remove osgDB::fstream and provided a convience
function such as:

 osgDB::open(std::fstream fs, const char*
filename,std::ios_base::openmode mode)
 {
   fs-open(OSGDB_CONVERT_UTF8_FILENAME(filename), mode);
 }

This would require going through the OSG examples that utilize the
fstream, replacing the fs.open(..) with an osgDB::open(fs,..) but this
wouldn't be too much work and would avoid the need for subclassing
fstream which doesn't sit that well with me as it's just done to hide
the UTF8 filename conversion.  I'm not the original author of this
code though, perhaps Michael Platings can dive in to explain the
reasoning.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org