[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type
Jim Schneider added the comment: Martin - provides a definition for mbstate_t only (at least on HP/UX 11i V2.0). I can verify that the problem still exists for Python 3.2.1. I am working on a workaround for this issue, and I will attach a patch once I get it to build. -- nosy: +jschneid ___ Python tracker <http://bugs.python.org/issue5999> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)
New submission from Jim Schneider : In Modules/getpath.c, the following line (#138) causes problems with some compilers (HP/UX 11, in particular - there could be others): static wchar_t *lib_python = L"lib/python" VERSION; Similarly, line #644: module_search_path = L"" PYTHONPATH; The default HP/UX compiler fails to compile this file with the error "Cannot concatenate character string literal and wide string literal". The attached patch converts these two string literals to wide string literals that the HP/UX compiler can understand. Very limited testing indicates that the patch is benign (it does not affect the build on Linux running on x86_64). -- components: Build files: getpath.patch keywords: patch messages: 140348 nosy: jschneid priority: normal severity: normal status: open title: Compiler workaround for wide string constants in Modules/getpath.c (patch) type: compile error versions: Python 3.2 Added file: http://bugs.python.org/file22655/getpath.patch ___ Python tracker <http://bugs.python.org/issue12561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type
Jim Schneider added the comment: I got it to build on HP-UX 11. However, there are a lot of compiler warnings about type mismatches, the _ctypes, _multiprocessing and termios modules failed to build, and "make test" died after not finding a usable "binascii" module. To get it to build, I did the following: 1) Applied the patch I attached to issue 12561 2) Created a directory sys, and copied /usr/include/sys/stdsyms.h into it. 3) Did "chmod 644" on sys/stdsyms.h and applied the patch stdsyms.patch that I've attached to this issue to it. 4) Ran configure with the argument "CPPFLAGS=-I." At this point, make ran to completion, and produced a python binary. However, "make test" dies within seconds of starting up. -- keywords: +patch Added file: http://bugs.python.org/file22656/stdsyms.patch ___ Python tracker <http://bugs.python.org/issue5999> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type
Jim Schneider added the comment: Martin - sys/_mbstate.h is only included if _INCLUDE__STDC_A1_SOURCE is defined. The only way this gets defined in the vendor-provided include files is if _XOPEN_SOURCE is defined and is equal to 500, or __STDC_VERSION__ is defined and is greater than or equal to 199901. I've attached a patch to broaden the _XOPEN_SOURCE case (as the test should clearly have been >=, not ==). Defining __STDC_VERSION__ to 199901 or greater will also do the job, but it feels more like a hack than just fixing what's broken in the vendor include files. -- ___ Python tracker <http://bugs.python.org/issue5999> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)
Jim Schneider added the comment: The __W macro is needed because the token-pasting operator binds to the macro's argument immediately; Having WCHAR(y) expand to __W(y) means that __W is passed WCHAR's argument after it's been macro-expanded. Without the intermediate step, WCHAR(VERSION) becomes LVERSION. As for the name - I have no objection to reasonable name changes. I picked WCHAR because it converts its argument to a wchar_t *. Finally - I am aware that the HP/UX C compiler is broken. Unfortunately, I am required to work with it, and can neither replace it nor ignore it. -- ___ Python tracker <http://bugs.python.org/issue12561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type
Jim Schneider added the comment: Yes, it is a patch to an HP-provided C compiler system header file. I cannot provide the actual file it patches, due to copyright limitations. -- ___ Python tracker <http://bugs.python.org/issue5999> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)
Jim Schneider added the comment: I am attaching an updated patch. This version specifically checks for __hpux, and the macro name has been changed to avoid clashing with other uses. -- Added file: http://bugs.python.org/file22663/getpath.patch ___ Python tracker <http://bugs.python.org/issue12561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
New submission from Jim Schneider : 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. -- components: Build files: termios.patch keywords: patch messages: 140423 nosy: jschneid priority: normal severity: normal status: open title: HP/UX compiler workarounds type: compile error versions: Python 3.2 Added file: http://bugs.python.org/file22664/termios.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)
Jim Schneider added the comment: I am collecting HP/UX compiler bug workarounds in issue 12572. Stinner - is the patch you mentioned in a released version of Python 3.2? Also, how is it affected by the fact that the (wide char) strings in question are constants? -- ___ Python tracker <http://bugs.python.org/issue12561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type
Jim Schneider added the comment: I am collecting HP/UX compiler workarounds in issue 12572. I will be adding patches to it as I produce them, including a patch to fix this on HP/UX. -- ___ Python tracker <http://bugs.python.org/issue5999> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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 -- Added file: http://bugs.python.org/file22666/fileutils.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- Added file: http://bugs.python.org/file22668/getpath.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- Added file: http://bugs.python.org/file22669/typeobject.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: Sorry - last comment should have been "compiler refuses to past*e*", not "past". -- ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- Added file: http://bugs.python.org/file22670/Python-ast.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- nosy: +eric.araujo, loewis, srid, terry.reedy ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: >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. -- ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)
Jim Schneider added the comment: Constant initializers are required to be constants, not function calls, so _Py_char2wchar cannot be used in the definition of lib_python (line #138 of Modules/getpath.c). -- ___ Python tracker <http://bugs.python.org/issue12561> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- Added file: http://bugs.python.org/file22671/getpath.patch ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12572] HP/UX compiler workarounds
Jim Schneider added the comment: 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. -- ___ Python tracker <http://bugs.python.org/issue12572> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com