This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _CRT_SECURE_NO_DEPRECATE macro redefinition with VC++ 8
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: loewis, wsfulton
Priority: normal Keywords:

Created on 2006-11-28 22:32 by wsfulton, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30709 - (view) Author: William Fulton (wsfulton) Date: 2006-11-28 22:32
I'm getting this warning with VC++ 8 for all extension modules:

e:\python25\include\pyconfig.h(42) : warning C4005:
'_CRT_SECURE_NO_DEPRECATE' : macro redefinition
        .\example_wrap.cxx(124) : see previous definition of
'_CRT_SECURE_NO_DEPRECATE'


because Python.h defines this macro without checking that it is not
already defined. Can you fix your headers so we don't get this warning?
It is impossible to work around this problem when dealing with multiple
versions of Python as we can't detect the version of Python until
Python.h is parsed - a catch 22 situation.

Can you use the same approach that we are using in SWIG? This is what we do:

#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) &&
!defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

Thanks
msg30710 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-29 21:12
This was fixed in r52817 and r52818
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44287
2006-11-28 22:32:21wsfultoncreate