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

Joe Buck Joe.Buck@synopsys.com
Mon Sep 19 17:25:00 GMT 2016


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.




More information about the Libstdc++ mailing list