This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB 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]

src/gdb ChangeLog python/python-internal.h


CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-05-30 08:56:56

Modified files:
	gdb            : ChangeLog 
	gdb/python     : python-internal.h 

Log message:
	Fix build breakage with Python 2.4.
	
	With Python 2.4, we see this build failure:
	
	./python/python-internal.h: In function 'gdb_Py_DECREF':
	./python/python-internal.h:179: warning: dereferencing 'void *' pointer
	./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union
	
	Python 2.4 forgets to cast 'op' to PyObject pointer on the ob_refcnt
	accesses:
	
	#define Py_DECREF(op)                                   \
	if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
	--(op)->ob_refcnt != 0)                     \
	_Py_CHECK_REFCNT(op)                    \
	else                                            \
	_Py_Dealloc((PyObject *)(op))
	
	...
	
	#define _Py_CHECK_REFCNT(OP)                                    \
	{       if ((OP)->ob_refcnt < 0)                                \
	_Py_NegativeRefcount(__FILE__, __LINE__,        \
	(PyObject *)(OP));         \
	}
	
	Python 2.7:
	
	#define Py_DECREF(op)                                   \
	do {                                                \
	if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
	--((PyObject*)(op))->ob_refcnt != 0)            \
	_Py_CHECK_REFCNT(op)                        \
	else                                            \
	_Py_Dealloc((PyObject *)(op));                  \
	} while (0)
	
	...
	
	#define _Py_CHECK_REFCNT(OP)                                    \
	{       if (((PyObject*)OP)->ob_refcnt < 0)                             \
	_Py_NegativeRefcount(__FILE__, __LINE__,        \
	(PyObject *)(OP));         \
	}
	
	gdb/
	2013-05-30  Pedro Alves  <palves@redhat.com>
	
	* python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject
	pointer.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15632&r2=1.15633
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/python-internal.h.diff?cvsroot=src&r1=1.77&r2=1.78


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