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: Fix mkdir() call for Watcom compilers on UNIX-like platforms
Type: compile error Stage: resolved
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Jeffrey.Armstrong
Priority: normal Keywords: patch

Created on 2015-04-06 12:41 by Jeffrey.Armstrong, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
watcom_qnx_to_unix-3.5.0a3.patch Jeffrey.Armstrong, 2015-04-06 12:41 Minor patch changing macros only on Watcom compilers
Messages (1)
msg240153 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2015-04-06 12:41
Within Modules/posixmodule.c:4914 (in 3.5.0a3), the preprocessor checks for compiler macros as such:

#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__)
        result = mkdir(path->narrow);
#else
        result = mkdir(path->narrow, mode);
#endif

The purpose of the code was to detect if we're compiling using Watcom, but not on QNX, or VisualAge as our compiler, where mkdir() wouldn't accept a mode.  However, Watcom supports Linux as well and properly implements the mode argument, causing the compilation to fail.

The proper check, rather than looking for "!defined(__QNX__)" would be "!defined(__UNIX__)," which would allow the code to properly compile using Watcom on either Linux or QNX:

#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__UNIX__)
        result = mkdir(path->narrow);
#else
        result = mkdir(path->narrow, mode);
#endif


FYI, in Watcom, the __UNIX__ macro is defined on both Linux and QNX, so this change will not break code for people who are still using Watcom to build Python for QNX (which is probably nobody at all).

There are two other places where the __QNX__ macro should be replaced in Modules/posixmodule.c, and the attached patch fixes both.
History
Date User Action Args
2022-04-11 14:58:15adminsetgithub: 68064
2018-08-04 18:01:00Jeffrey.Armstrongsetstatus: open -> closed
resolution: wont fix
stage: resolved
2015-04-06 12:41:15Jeffrey.Armstrongcreate