Hi,

I recently noticed that some of the source files in my project were compiling, but were not generating some expected warnings. I believe I have tracked the problem back to a number of OSG headers that are disabling warnings, but never set them back to their original setting.

The headers of interest are as follows:
1) include/osg/Export
2) include/osgDB/Export
3) include/osgGA/Export
4) include/osgText/Export
5) include/osgUtil/Export
6) include/osgViewer/Export

Note: This issue is MSVC specific, and only when OSG_DISABLE_MSVC_WARNINGS is defined (it appears to be
defined by default).

Example code from include/osgGA/Export:

#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS)
    #pragma warning( disable : 4244 )
    #pragma warning( disable : 4251 )
    #pragma warning( disable : 4267 )
    #pragma warning( disable : 4275 )
    #pragma warning( disable : 4290 )
    #pragma warning( disable : 4786 )
    #pragma warning( disable : 4305 )
    #pragma warning( disable : 4996 )
#endif

Therefore, any header that includes an Export header will result in warnings being disabled, and any user code that includes an Export header, or any header that includes an Export header will have to wrap them in #pragma warning(push/pop) or deal with warnings being disabled silently behind the scenes.

Regards,

Judson
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to