New submission from Naoyuki Tai <n...@users.sourceforge.net>:

Python can build without _XOPEN_SOURCE_EXTENDED on HPUX ia64 but the
socket module is bust.
This is because APIs like getsockname() do not use socklen_t*. Instead
it is defined using int* for some of arguments.
In socketmodule.c, it consistently use socklent_t which is the right
thing for the rest of world.
Because socklent_t is 64bit (same as size_t) and int is 32bit, it
compiles with warnings of different types of pointer but it compiles anyway.
The result is that, getsockname(), etc. take a look at the 32bit out of
64bit value thinking it is "zero" (big endian machine).
APIs succeed without error but the result does not come back since the
API calls think that the return value buffer size is 0.

My Python build is 2.5. I think the same is true for all versions
thereafter. I wish I could give you a diff but I don't know well enough
the socketmodule.c what's the right thing to do.
I cannot use _XOPEN_SOURCE_EXTENDED as I have other python bindings and
modules built without _XOPEN_SOURCE_EXTENDED.

----------
components: Extension Modules
messages: 86889
nosy: ntai
severity: normal
status: open
title: socketmodule.c  on HPUX ia64 without _XOPEN_SOURCE_EXTENDED compiles 
incorrectly
type: compile error
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5895>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to