Hi Robert,

I think option A is better, since then people who want to use more
aggressive warnings (and can accept the consequences) still have that
option. Option B simply makes the flag the same whether
OSG_USE_AGGRESSIVE_WARNINGS is ON or OFF, so the option has no use on
Windows...

Is -Wall /W3 the default then?  This is what is now used when enabling
OSG_USE_AGGRESSIVE_WARNINGS.

No, when OSG_USE_AGGRESSIVE_WARNINGS is OFF then only /W3 is enabled, /Wall is not.

I just checked, and it seems /Wall is the option causing the noise. Setting OSG_AGGRESSIVE_WARNING_FLAGS to "/Wall /W3" (as you had done) still blurted out a great number of warnings in the standard C++ headers / headers provided by the compiler.

I tried setting OSG_AGGRESSIVE_WARNING_FLAGS to /W4 only (no /Wall) and I got a few warnings which I didn't get before with only /W3, and no warnings in the standard headers:

1>------ Build started: Project: OpenThreads, Configuration: Debug Win32 ------
1>Compiling...
1>Atomic.cpp
1>..\..\..\..\src\OpenThreads\common\Atomic.cpp(133) : warning C4239: nonstandard extension used : 'static_cast' : conversion from 'volatile const long' to 'volatile const unsigned int &'
1>        A non-const reference may only be bound to an lvalue
1>Version.cpp
1>Win32ThreadBarrier.cpp
1>Win32Thread.cpp
1>..\..\..\..\src\OpenThreads\win32\Win32Thread.cpp(136) : warning C4189: 'pd' : local variable is initialized but not referenced
1>Win32Mutex.cpp
1>WIN32Condition.cpp
1>Generating Code...
1>c:\dev\openscenegraph-svn\openscenegraph\src\openthreads\win32\win32thread.cpp(440) : warning C4702: unreachable code
1>Compiling manifest to resources...
1>Linking...
1>LINK : C:\Dev\OpenSceneGraph-SVN\OpenSceneGraph\build\bin\RelWithDebInfo\..\..\bin\ot11-OpenThreads.dll not found or not built by the last incremental link; performing full link 1> Creating library C:\Dev\OpenSceneGraph-SVN\OpenSceneGraph\build\lib\RelWithDebInfo\..\OpenThreads.lib and object C:\Dev\OpenSceneGraph-SVN\OpenSceneGraph\build\lib\RelWithDebInfo\..\OpenThreads.exp
1>Embedding manifest...
1>Build log was saved at "file://c:\Dev\OpenSceneGraph-SVN\OpenSceneGraph\build\src\OpenThreads\win32\OpenThreads.dir\RelWithDebInfo\BuildLog.htm"
1>OpenThreads - 0 error(s), 3 warning(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

So I suggest setting OSG_AGGRESSIVE_WARNING_FLAGS to /W4. The effect will be that when OSG_USE_AGGRESSIVE_WARNINGS is OFF, then /W3 is used, and when it's on, /W4 will be used. The default of OSG_USE_AGGRESSIVE_WARNINGS being ON will mean we'll have a few warnings to fix to get a clean bill of health I imagine.

Could someone more knowledgeable than me in these things (Matthew Fuesz for example?) comment? Are there other flags we could use to be even more aggressive on warnings, but still not get warnings in the standard headers which we have no control over?

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to