New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings when building on AIX #66653
Comments
Building Python 2.7.8 on AIX 7.1 gives the following warnings: Parser/pgen.c:282:9: warning: variable 'i' set but not used [-Wunused-but-set-variable] |
The most serious of these IMO is the signed overflow warnings in Modules/cPickle.c. I get the same warnings if I disable the “gcc -fwrapv” mode: /media/disk/home/proj/python/cpython/Modules/cPickle.c: In function ‘Unpickler_noload’: It is not clear to me where the overflows actually happen. See bpo-1608, bpo-1621, where some of these bugs were fixed, and the “gcc -fwrapv” workaround was enabled. Perhaps your compiler has a similar flag to use as a workaround, though IMO it would be good to fix the code as well. Most of the other warnings have been fixed or worked around in Python 3. I propose to port the following revisions to Python 2. All but one are still in effect today: 83a55ca935f0: Parser/pgen.c That leaves the two warnings about CTYPES_CAPSULE_WCHAR_T. If necessary, they could be worked around by adding an #if condition around the definitions: #if defined(CTYPES_UNICODE) && !defined(HAVE_USABLE_WCHAR_T)
# define CTYPES_CAPSULE_WCHAR_T "_ctypes/[. . .].c wchar_t buffer from unicode"
CTYPES_CAPSULE_INSTANTIATE_DESTRUCTOR(CTYPES_CAPSULE_WCHAR_T)
#endif |
Looking closer at cPickle.c (after upgrading my GCC), I think there are two warnings happening, when Pdata_clear() is inlined into each of noload_reduce() and noload_setitem(). I think both cases are false positives; there is no actual signed overflow possible. Ismail Donmez has provided patches that work around this warning in bpo-1621, but IMO, and maybe in the general consensus, we shouldn’t add these workarounds. |
These look like false positives or noise to me as well. |
New changeset 0b63465a1796 by Martin Panter in branch '2.7': |
New changeset b1c1c297bead by Martin Panter in branch '2.7': |
New changeset ffe866aa86a8 by Martin Panter in branch '2.7': |
FWIW on the current AIX buildbot <http://buildbot.python.org/all/builders/PPC64%20AIX%202.7\> I don’t see any cPickle.c warnings. (Nor on the earliest build available on that buildbot, from Nov 2015.) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: