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: selectmodule.c does not compile on HP-UX due to bpo-31938/6dc57e2a20c
Type: compile error Stage: resolved
Components: Build, Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: michael-o, taleinat
Priority: normal Keywords: easy (C), patch

Created on 2018-08-17 09:28 by michael-o, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8796 merged michael-o, 2018-08-17 10:48
Messages (5)
msg323640 - (view) Author: Michael Osipov (michael-o) * Date: 2018-08-17 09:28
It seems like an oversight of the author, though it is not clear why this happily compiles with clang 3.4.1 on FreeBSD 10.4-STABLE and GCC on RHEL6.

The error is (HP-UX 11.31 and HP C/aC++ B3910B A.06.28.03 [Dec 13 2016]):

> /opt/aCC/bin/cc -Ae +z -O -I./Include -I. -I/usr/local/include -I/var/osipovmi/cpython/Include -I/var/osipovmi/cpython -c /var/osipovmi/cpython/Modules/selectmodule.c -o build/temp.hp-ux-B.11.31-ia64-3.8-pydebug/var/osipovmi/cpython/Modules/selectmodule.o
> "/var/osipovmi/cpython/Modules/selectmodule.c", line 412: warning #4232-D:
>           conversion from "PyObject *" to a more strictly aligned type
>           "PyDictObject *" may cause misaligned access
>       self->ufd_len = PyDict_GET_SIZE(self->dict);
>                       ^
> 
> "/var/osipovmi/cpython/Modules/selectmodule.c", line 849: error #2130:
>           expected a "{"
>   static PyObject *
>   ^
> 
> "/var/osipovmi/cpython/Modules/selectmodule.c", line 898: error #2101:
>           "timeout_obj" has already been declared in the current scope
>       PyObject *result_list = NULL, *timeout_obj = NULL;
>                                      ^
> 
> 2 errors detected in the compilation of "/var/osipovmi/cpython/Modules/selectmodule.c".


caused by:

> +static PyObject *
> +select_devpoll_modify_impl(devpollObject *self, int fd,
> +                           unsigned short eventmask)
> +/*[clinic end generated code: output=bc2e6d23aaff98b4 input=f0d7de3889cc55fb]*/
>  static PyObject *
>  devpoll_modify(devpollObject *self, PyObject *args)
>  {
> -    return internal_devpoll_register(self, args, 1);
> +    return internal_devpoll_register(self, fd, eventmask, 1);
>  }

Signature change, but prototype has not been changed.

>  static PyObject *
> -poll_poll(pollObject *self, PyObject *args)
> +select_poll_poll_impl(pollObject *self, PyObject *timeout_obj)
> +/*[clinic end generated code: output=876e837d193ed7e4 input=7a446ed45189e894]*/
>  {
> -    PyObject *result_list = NULL, *timeout_obj = NULL;
> +    PyObject *result_list = NULL;
>      int poll_result, i, j;
>      PyObject *value = NULL, *num = NULL;
>      _PyTime_t timeout = -1, ms = -1, deadline = 0;
>      int async_err = 0;
> 
> -    if (!PyArg_ParseTuple(args, "|O:poll", &timeout_obj)) {
> -        return NULL;
> -    }
> -
> -    if (timeout_obj != NULL && timeout_obj != Py_None) {
> +    if (timeout_obj != Py_None) {

timeout_obj has been added to the function signature, but the internal NULL assignment has not been removed.
msg323642 - (view) Author: Michael Osipov (michael-o) * Date: 2018-08-17 09:50
A PR is in preparation.
msg323650 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-17 11:43
New changeset 0e6e7a1e52a53090e33ebef13f8f1fbe9bec2375 by Tal Einat (Michael Osipov) in branch 'master':
bpo-34419: selectmodule.c does not compile on HP-UX due to bpo-31938 (GH-8796)
https://github.com/python/cpython/commit/0e6e7a1e52a53090e33ebef13f8f1fbe9bec2375
msg323652 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-17 11:45
Michael, thanks for catching this and supplying a PR!
msg323653 - (view) Author: Michael Osipov (michael-o) * Date: 2018-08-17 12:01
Bevakasha!
History
Date User Action Args
2022-04-11 14:59:04adminsetgithub: 78600
2018-08-17 12:01:36michael-osetmessages: + msg323653
2018-08-17 11:45:01taleinatsetstatus: open -> closed
resolution: fixed
messages: + msg323652

stage: patch review -> resolved
2018-08-17 11:43:06taleinatsetmessages: + msg323650
2018-08-17 10:48:58michael-osetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request8271
2018-08-17 09:50:50michael-osetmessages: + msg323642
2018-08-17 09:41:01serhiy.storchakasetkeywords: + easy (C)
nosy: + taleinat

stage: needs patch
2018-08-17 09:37:54michael-osettitle: selectmodule.c does not compile on HP-UX due to bpo-31938/6dc57e2a20c5beb99e8bf5eb04cc836d53fa9aee -> selectmodule.c does not compile on HP-UX due to bpo-31938/6dc57e2a20c
2018-08-17 09:28:09michael-ocreate