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: Redefinition of HAVE_STRFTIME can cause compiler errors.
Type: compile error Stage:
Components: Windows Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, braden, rgpitts
Priority: normal Keywords: patch

Created on 2009-09-02 09:39 by rgpitts, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
issue-6820.patch rgpitts, 2011-07-21 07:36 pyconfig.h patch review
Messages (6)
msg92159 - (view) Author: rgpitts (rgpitts) Date: 2009-09-02 09:39
I'm working with the Python C API and omniOrb with Visual Studio 2008 
on Windows XP. 

A OmniOrb header corba_sys_dep.h is defining HAVE_STRFTIME as 1
...
#define HAVE_STRFTIME 1
...

pyconfig.h is then defining this again. 
...
#define HAVE_STRFTIME
...

This is raising a compiler warning and then multiple syntax errors in 
math.h depending on the order of inclusion of these headers. If the 
pyconfig.h is included after corba_sys_dep.h multiple syntax errors. 
However if it is included before only a warning is raised.

I think pyconfig.h needs changing to
#ifndef HAVE_STRFTIME
#define HAVE_STRFTIME
#endif
msg92209 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-09-03 13:07
Those HAVE_XXX symbols should be defined like autoconf does:
#define HAVE_STRFTIME 1
This is what happens on Unix platforms, and AFAIK this plays well with
other libraries which define the same symbols.
msg99337 - (view) Author: Braden McDaniel (braden) Date: 2010-02-14 07:43
In general, this does *not* play well with libraries that define the same symbols.

It is not correct to install the AC_CONFIG_HEADERS. Any macros in an installed configuration header need to be namespaced per-project; e.g., PYTHON_HAVE_STRFTIME.
msg140792 - (view) Author: rgpitts (rgpitts) Date: 2011-07-21 07:36
As Python 2.6 is now security only and 2.7 is last major release I've patched this against Python 3.2 because pyconfig.h hadn't changed much since 2.6.

I've done as Amaury suggested and changed the HAVE_XXX symbols to define 1 like autoconf. 'make patchcheck' has fixed some general formatting issues included in the patch.
msg223153 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-15 21:43
There is no way that I'm commenting on the patch as it's against pyconfig.h, what do our experts think of this?
msg236322 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-02-20 19:17
Having had another look the patch is not acceptable as the majority of the changes are to whitespace only.
History
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51069
2021-08-07 10:54:14iritkatrielsetversions: + Python 3.11, - Python 3.4, Python 3.5
2019-03-15 22:48:48BreamoreBoysetnosy: - BreamoreBoy
2015-02-20 19:17:50BreamoreBoysetmessages: + msg236322
2014-07-15 21:43:52BreamoreBoysetnosy: + BreamoreBoy

messages: + msg223153
versions: + Python 3.4, Python 3.5, - Python 2.6
2011-07-21 07:37:02rgpittssetfiles: + issue-6820.patch
keywords: + patch
messages: + msg140792
2010-02-14 07:43:58bradensetnosy: + braden
messages: + msg99337
2009-09-03 13:07:22amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg92209
2009-09-02 09:39:44rgpittscreate