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: select module compile errors with broken poll()
Type: compile error Stage: resolved
Components: Build Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Jeffrey.Armstrong, neologix, python-dev
Priority: normal Keywords:

Created on 2013-01-13 15:16 by Jeffrey.Armstrong, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
select_module_patch.txt Jeffrey.Armstrong, 2013-01-18 23:21 Patch for selectmodule.c in Python 3.3.0
Messages (5)
msg179880 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2013-01-13 15:16
On a platform with a broken poll() function (as detected during configure), Modules/selectmodule.c fails to compile.  The error occurs at two points:

./Modules/selectmodule.c:2100: `select_poll' undeclared here (not in a function)
./Modules/selectmodule.c:2100: initializer element is not constant
./Modules/selectmodule.c:2100: (near initialization for `select_methods[1].ml_meth')
./Modules/selectmodule.c:2100: `poll_doc' undeclared here (not in a function)
./Modules/selectmodule.c:2100: initializer element is not constant
./Modules/selectmodule.c:2100: (near initialization for `select_methods[1].ml_doc')
./Modules/selectmodule.c: In function `PyInit_select':
./Modules/selectmodule.c:2159: `poll_Type' undeclared (first use in this function)
./Modules/selectmodule.c:2159: (Each undeclared identifier is reported only once
./Modules/selectmodule.c:2159: for each function it appears in.)

The problem is occurring because both "select_poll" and "poll_Type" are undeclared if HAVE_BROKEN_POLL is declared.  The fix would be on two lines:

selectmodule.c:2099
#ifdef(HAVE_POLL)
should be:
#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)

selectmodule.c:2149
#if defined(HAVE_POLL)
should be:
#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)

Making these two minor changes allows selectmodule.c to compile fine in the case where the platform has a "broken" poll().

This bug was found on m68k-atari-mint compiling using gcc 2.95.3
msg180198 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-01-18 17:21
Could you provide the patch?
It's trivial, but at least we'll make sure the patch fixes the problem on your platform.
msg180231 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2013-01-18 23:21
I've attached the patch, and I probably should have done so in the first place.  It applies to Python 3.3.0.  The resulting code compiles fine on m68k-atari-mint.  It shouldn't affect any of the major platforms.
msg180241 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-19 11:40
New changeset 1d33c79d2f6b by Charles-François Natali in branch '2.7':
Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
http://hg.python.org/cpython/rev/1d33c79d2f6b

New changeset 101e821e5e70 by Charles-François Natali in branch '3.2':
Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
http://hg.python.org/cpython/rev/101e821e5e70

New changeset f04c97bbb241 by Charles-François Natali in branch '3.3':
Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
http://hg.python.org/cpython/rev/f04c97bbb241

New changeset 79912bb1a884 by Charles-François Natali in branch 'default':
Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
http://hg.python.org/cpython/rev/79912bb1a884
msg180242 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-01-19 12:03
Committed, thanks for the patch!
History
Date User Action Args
2022-04-11 14:57:40adminsetgithub: 61157
2013-01-19 12:03:26neologixsetstatus: open -> closed

stage: resolved
messages: + msg180242
versions: + Python 2.7, Python 3.2, Python 3.4
2013-01-19 11:40:31python-devsetnosy: + python-dev
messages: + msg180241
2013-01-18 23:21:49Jeffrey.Armstrongsetfiles: + select_module_patch.txt

messages: + msg180231
2013-01-18 17:21:59neologixsetnosy: + neologix
messages: + msg180198
2013-01-13 15:33:08Jeffrey.Armstrongsettype: compile error
2013-01-13 15:16:47Jeffrey.Armstrongcreate