Archive: best place to add _CRT_SECURE_NO_WARNINGS in Scons config?


best place to add _CRT_SECURE_NO_WARNINGS in Scons config?
USING: Scons v0.96.94.D001 and VS8+SP1+SP-Vista to build CVS version of NSIS 2.23 - 20060130

ISSUE:
When building NSIS we get errors. It is assumed some Microsoft guy thought it was good to boyot open source development I bet, since Valid C POSIX code does not get compiled straight away with VS8+SP1+SP-Vista

To avoid compile errors we need to add "_CRT_SECURE_NO_WARNINGS" somewhere to the scons build config.

Q:
Where is the best spot to add this?


SCons\Config\ms:

defenv.Append(CPPDEFINES = ['_CRT_SECURE_NO_WARNINGS'])
Do you have a test case for when compilation fails without this? If so, a configuration check can be added.

Thanks,

but reflecting about implications I decided to leave the warning as is, it's a better indication.

and no for, "Do you have a test case for when compilation fails without this". It does not fail, so see above.

IMHO
I would NOT fix the code as advise by the warning due to backwards compiler compatibility. It is probabbly that MS wants to sabotage crossplatform building in small amounts..

Maybe a stub for printf > printf_s? etc.


There's _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES for automatic translation to safe string functions.