Hi Johannes,

thanks for the good explanation Yes, now is all clear. I will wait for the OSGConfig.h fix from Gerrit.


Am 04.05.2011 12:10, schrieb Johannes Brunen:
Hello Dominik,

The flag OSG_DISABLE_MICROSOFT_SECURE_CXXX handles the following microsoft
defines:

OSG_DISABLE_MICROSOFT_SECURE_CXXX = ON =>
     -D _CRT_SECURE_NO_DEPRECATE
     -D _CRT_SECURE_NO_WARNINGS
     -D _CRT_NONSTDC_NO_DEPRECATE
     -D _SECURE_SCL = 0
     -D _SCL_SECURE_NO_WARNINGS
     -D _SCL_SECURE_NO_DEPRECATE

See in CMake/UpdateCompiler.cmake around line 100

Let me cite the MSDN:

_SECURE_SCL
Checked iterators ensure that you do not overwrite the bounds of your
container.
Defines whether Checked Iterators are enabled. If defined as 1, unsafe
iterator use causes a runtime error. If defined as 0, checked iterators are
disabled. .... The default value for _SECURE_SCL is 1, meaning checked
iterators are enabled by default.

_SCL_SECURE_NO_WARNINGS
Calling any one of the potentially unsafe methods in the Standard C++
Library will result in Compiler Warning (level 3) C4996. To disable this
warning, define the macro _SCL_SECURE_NO_WARNINGS

_SCL_SECURE_NO_DEPRECATE
suppresses the C++ library related deprecations

_CRT_SECURE_NO_WARNINGS
...eliminate deprecation warnings for the older, less secure functions. The
simplest is simply to define _CRT_SECURE_NO_WARNINGS or use the warning
pragma.

_CRT_SECURE_NO_DEPRECATE
suppresses the C library related deprecations

_CRT_NONSTDC_NO_DEPRECATE
Another source of deprecation warnings, unrelated to security, is the POSIX
functions. Replace POSIX function names with their standard equivalents (for
example, change access to _access), or disable POSIX-related deprecation
warnings by defining _CRT_NONSTDC_NO_WARNINGS.


The flag OSG_DISABLE_MS_ITERATOR_DEBUGGING handles the following microsoft
define:

OSG_DISABLE_MS_ITERATOR_DEBUGGING = ON =>
-D_HAS_ITERATOR_DEBUGGING=0

See in CMake/UpdateCompiler.cmake around line 114

> From MSDN:
_HAS_ITERATOR_DEBUGGING
Defines whether the iterator debugging feature is enabled in a debug build.
By default, iterator debugging is enabled.


Be aware the _HAS_ITERATOR_DEBUGGING is independent from the _SECURE_SCL
stuff.

I normally use
OSG_DISABLE_MICROSOFT_SECURE_CXXX=ON
OSG_DISABLE_MS_ITERATOR_DEBUGGING=OFF

The _HAS_ITERATOR_DEBUGGING does have quite a performance impact which I do
not tolerate therefore I do not use it.
http://lists.boost.org/Archives/boost/2006/02/101369.php

However, I have read that problems showed up with the VC10 compiler (which I
do not use currently) with respect to the flag. So it might be better to
leave the default for this one.
http://social.msdn.microsoft.com/Forums/en-ZA/vcgeneral/thread/44f41bcd-b2c0-4abf-80d0-f319a6265a88


At last I would like to give a warning because libraries compiled with
different settings of these flags are not ABI compatible. So if you use a
setting use it for all libraries that use STL/Boost etc. components in their
interface.

At very last please look into the following thread
http://www.mail-archive.com/opensg-users%40lists.sourceforge.net/msg13745.html.
The current OSGConfig.h might be not correct. Gerrit is checking that.

I hope I could shed some light on the topic...

Best,
Johannes

PS.: See also
http://www.mail-archive.com/opensg-users@lists.sourceforge.net/msg13639.html





------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today.  Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users


--
Dominik Acri

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstrasse 5 | 64283 Darmstadt | Germany
Telefon +49 6151 155-630 | Fax +49 6151 155-139
dominik.a...@igd.fraunhofer.de | www.igd.fraunhofer.de

<<attachment: Dominik_Acri.vcf>>

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to