This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] libstdc++/77645 fix deque and vector xmethods for Python 3


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]