This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: [PATCH] libstdc++/77645 fix deque and vector xmethods for Python 3
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 19 Sep 2016 17:24:53 +0000
- Subject: RE: [PATCH] libstdc++/77645 fix deque and vector xmethods for Python 3
- Authentication-results: sourceware.org; auth=none
- References: <20160919171125.GA31777@redhat.com>
Python has a distinct integer division operator, "//". 7 // 3 returns the integer 2.
-----Original Message-----
From: libstdc++-owner@gcc.gnu.org [mailto:libstdc++-owner@gcc.gnu.org] On Behalf Of Jonathan Wakely
Sent: Monday, September 19, 2016 10:11 AM
To: libstdc++@gcc.gnu.org; gcc-patches@gcc.gnu.org
Subject: [PATCH] libstdc++/77645 fix deque and vector xmethods for Python 3
The problem for these xmethods is that in Python 3 division of two integers produces a float, and GDB then doesn't allow that value to be used for pointer arithmetic (https://sourceware.org/PR20622).
PR libstdc++/77645
* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__)
(DequeWorkerBase.index, VectorWorkerBase.get): Cast results of
division to int to work with Python 3.
Tested x86_64-linux, committed to trunk.
I'll fix it for gcc-5 and gcc-6 too.