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.

Title: HP/UX compiler workarounds
Type: compile error Stage: resolved
Components: Build Versions: Python 3.2
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, jschneid, loewis, michael-o, srid, terry.reedy, vstinner
Priority: normal Keywords: patch

Created on 2011-07-15 15:40 by jschneid, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
termios.patch jschneid, 2011-07-15 15:40 Fix for missing struct termios definition
fileutils.patch jschneid, 2011-07-15 15:55 Workaround for compiler namespace error (ref issue 5999)
getpath.patch jschneid, 2011-07-15 16:01 Fix for string pasting bug (issue 12561).
typeobject.patch jschneid, 2011-07-15 16:05 Explicit casts to void * to silence compiler warnings.
Python-ast.patch jschneid, 2011-07-15 16:07 Add "static" keywords to reduce compiler noise
getpath.patch jschneid, 2011-07-15 17:29 Fix for string pasting bug (issue 12561)
hp-ux-compiler-workarounds.diff eric.araujo, 2011-07-19 15:21
Messages (22)
msg140423 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 15:40
The C compiler that comes with HP/UX 11 has some shortcomings that prevent building Python 3.2.1 out of the box.  I am attaching patches here as I work through issues.

The first patch fixes namespace shortcomings when trying to use struct termios.
msg140429 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 15:55
This patch works around the problem underlying issue 5999 by making sure the __STDC_VERSION__ macro is defined and has a value of at least 199901
msg140430 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-15 15:56
You may the number of this issue in a comment of your patch.
msg140431 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-15 15:59
Oops. You may *add* the number of this issue in a comment of your patch.
msg140433 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:01
Workaround for compiler bug; HP/UX compiler refuses to past (implicitly char *) string constants with wide (wchar_t *) string constants.  This patch is also pasted to issue 12561 (which should be closed).

Note:  There is disagreement as to the best way to proceed on this issue.  Stinner (aka haypo) has a patch that should work with non ASCII character sets, and my patch will almost certainly not work in those cases.  YMMV.
msg140434 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:02
Sorry - last comment should have been "compiler refuses to past*e*", not "past".
msg140435 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-15 16:04
I think that getpath.patch is wrong (it's just a workaround hiding a real bug): see msg140422 of the issue #12561.
msg140436 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:05
This patch just reduces compiler noise by explicitly casting pointers to void *.  I expect the Visual Studio C/C++ compiler suite also issued these warnings, too.
msg140439 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:07
The HP/UX C compiler grumbles when a symbol that is declared static is later defined without the static storage class specifier.  The attached patch just adds the missing "static" keywords.
msg140440 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:12
I'm adding the original listeners for issue 5999 to this one.

The fileutils.patch patch attached to this issue directly addresses what's wrong in issue 5999; I'd consider it closed, but as I didn't open it, and I'm not actually part of the python project, that's not my call to make.
msg140442 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 16:16
From issue 12561 (which I will be closing):

Author: STINNER Victor (haypo) *  Date: 2011-07-15 15:36  
Use >L"" CONSTANT< to decode a byte string to a character string doesn't work with non-ASCII strings. _Py_char2wchar() should be used instead: see for example this fix, commit 5b6e13b6b473. 

This is in reference to getpath.patch.  I have no need to support internationalized versions of the constant strings my patch addresses, so Stinner's commit is overkill for me.
msg140443 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-15 16:17
Minor note: we prefer unified diffs, and when possible, all related changes in one file.  See

I can’t review the patches, as I don’t know C nor HP/UX.  I’m not sure why you opened this report instead of following on the other one :)
msg140446 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 17:29
Update to getpath.patch (issue 12561) - this version uses _Py_char2wchar where possible.  Unfortunately, as lib_python is declared and defined statically, this can't be used in both cases where the HP/UX compiler has issues.
msg140454 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-07-15 18:48
>The fileutils.patch patch attached to this issue directly addresses what's wrong in issue 5999; I'd consider it closed, ...

When an patch is committed that fixes that issue, say so there and I or someone will close it.

>From issue 12561 (which I will be closing):...
so Stinner's commit is overkill for me.

Issues sometimes expand beyond the original request. It is unclear to me whether Victor thinks that that issue is finished. If he thinks more should be done, then I think it should be left open.
msg140467 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-15 19:30
Terry - I apologize for jumping the gun a bit, and let me be a bit more clear.  When I realized that the HP/UX compiler was going to have as many problems as it does compiling python 3, I decided it would be best to create a single issue for all of the compiler issues.  In retrospect, opening an issue for the single compiler bug discussed in issue 12561 was a mistake, and I had hoped to migrate the discussion of that issue here.
msg140485 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-07-16 09:59
Please don't manage independent bugs in a single issue, even if they are related. The way this is done here will it make hard to track what exactly has been done, and what needs to be done.

As it stands, please combine all patches into a single one, and we won't commit anything until the entire patch passes.
msg140589 - (view) Author: Jim Schneider (jschneid) Date: 2011-07-18 14:36
Martin - I don't have time to manage your project's administrative requirements with respect to my fixes.  I'm providing them out of the hope they will be of use to others who need to build on HP/UX, but I don't really care if they make it into the main branch or not.
msg140675 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-19 15:16
Here’s a unified diff.
msg140676 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-19 15:21
Arg, I thought I removed a duplicate patch but it was actually an updated version.  Sorry about that; the link in the history at the bottom of this page still links to the file.  Updated unified diff attached.
msg140677 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-19 15:29
Jim: Sorry if we reacted first with process remarks instead of thanking you for the patches and reviewing them.  We value contributions, and we try to be welcoming, but sometimes we forget what it’s like to enter this community.  Some things have become basic for us, like working with one unified diff instead of many context diffs, so we try to guide contributors so that their files can be easily read and fed to tools (such as code review or version control) and we can all move faster in the discussion leading to the commit.  This is not about project administration, merely common formats to make work easier for all parties involved (for example, for users generating one diff for a whole checkout is easier than generating and uploading one diff per file).

So, I hope that the diff I generated from yours will let people review it quickly, with no hurt feelings.
msg327757 - (view) Author: Michael Osipov (michael-o) * Date: 2018-10-15 13:59
I believe this issue can be safely closed. It is a no-brainer to compile Python from master on HP-UX with aCC these days. It works for me at least.
msg327770 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-10-15 18:10
Thank you for the update.  I think any problems with the current HP/UX compiler are best reported on a new issue.
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56781
2018-10-15 18:10:39terry.reedysetstatus: open -> closed
resolution: out of date
messages: + msg327770

stage: resolved
2018-10-15 13:59:54michael-osetnosy: + michael-o
messages: + msg327757
2014-06-13 16:01:52vstinnerunlinkissue12561 superseder
2014-06-13 16:00:59Jim.Jewettlinkissue12561 superseder
2012-03-01 13:38:06eric.araujosetfiles: + getpath.patch
2011-07-19 15:29:03eric.araujosetmessages: + msg140677
2011-07-19 15:21:55eric.araujosetfiles: - hp-ux-compiler-workarounds.diff
2011-07-19 15:21:46eric.araujosetfiles: + hp-ux-compiler-workarounds.diff

messages: + msg140676
2011-07-19 15:16:15eric.araujosetfiles: + hp-ux-compiler-workarounds.diff

messages: + msg140675
2011-07-19 15:14:44eric.araujosetfiles: - getpath.patch
2011-07-18 14:36:07jschneidsetmessages: + msg140589
2011-07-16 09:59:20loewissetmessages: + msg140485
2011-07-15 19:30:39jschneidsetmessages: + msg140467
2011-07-15 18:48:02terry.reedysetmessages: + msg140454
2011-07-15 17:29:07jschneidsetfiles: + getpath.patch

messages: + msg140446
2011-07-15 16:17:14eric.araujosetmessages: + msg140443
2011-07-15 16:16:14jschneidsetmessages: + msg140442
2011-07-15 16:12:49jschneidsetnosy: + loewis, terry.reedy, eric.araujo, srid
messages: + msg140440
2011-07-15 16:07:31jschneidsetfiles: + Python-ast.patch

messages: + msg140439
2011-07-15 16:05:02jschneidsetfiles: + typeobject.patch

messages: + msg140436
2011-07-15 16:04:11vstinnersetmessages: + msg140435
2011-07-15 16:02:36jschneidsetmessages: + msg140434
2011-07-15 16:01:55jschneidsetfiles: + getpath.patch

messages: + msg140433
2011-07-15 15:59:43vstinnersetmessages: + msg140431
2011-07-15 15:56:08vstinnersetmessages: + msg140430
2011-07-15 15:55:41jschneidsetfiles: + fileutils.patch

messages: + msg140429
2011-07-15 15:47:33vstinnersetnosy: + vstinner
2011-07-15 15:40:25jschneidcreate