classification
Title: For non-debug builds, the cygwinccompiler.py should define NDEBUG
Type: Stage:
Components: Distutils Versions: Python 3.2, Python 3.1, Python 3.0, Python 2.7, Python 2.6, Python 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: rpetrov, stutzbach, tarek (3)
Priority: Keywords

Created on 2009-10-21 17:48 by stutzbach, last changed 2009-10-22 22:14 by rpetrov.

Messages (4)
msg94315 - (view) Author: Daniel Stutzbach (stutzbach) Date: 2009-10-21 17:48
Currently, msvccompiler.py defines NDEBUG for non-debug builds.  Unix
builds do as well, via python-config.  However, cygwinccompiler.py does not.
msg94326 - (view) Author: Roumen Petrov (rpetrov) Date: 2009-10-21 21:51
Posix build system read flags from makefile.
Configure script add -DNDEBUG to OPT flag. So why cygwinccompiler.py has
to set this ?
Next cygwinccompiler currently is not used in python build system.
msg94327 - (view) Author: Daniel Stutzbach (stutzbach) Date: 2009-10-21 21:58
Sorry, I should have said the mingw32 compiler, which is contained in
cygwincompiler.py  The mingw32 compiler is a free compiler compatible
with MSVC.  Since it's used with the Windows version of python, there is
no configure script.

I noticed this when trying to build an extension module with "python
setup.py build -c mingw32", using the Windows (not cygwin) version of
python.  The extension module failed to compile because had a line like
this:
  assert(my_struct->debug_only_field);

where "debug_only_field" is only declared if Py_DEBUG is set.  When
NDEBUG is set, the assert disappears and the compile works as expected.
msg94372 - (view) Author: Roumen Petrov (rpetrov) Date: 2009-10-22 22:14
Ok Daniel.
In this case for debug build _DEBUG has to be defined too - please check
pyconfig.h from MSVC builds.
May be you could use CFLAGS environment variable.
History
Date User Action Args
2009-10-22 22:14:04rpetrovsetmessages: + msg94372
2009-10-21 21:58:13stutzbachsetmessages: + msg94327
2009-10-21 21:51:17rpetrovsetnosy: + rpetrov
messages: + msg94326
2009-10-21 17:49:00stutzbachcreate