This is the mail archive of the gdb-testers@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]

[binutils-gdb] Avoid -Wduplicated-cond warnings in gdb/python


*** TEST RESULTS FOR COMMIT 12c58cd4dc805cbac97a6d93c971c2496313dce4 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: 12c58cd4dc805cbac97a6d93c971c2496313dce4

Avoid -Wduplicated-cond warnings in gdb/python

I tried building gdb with -Wduplicated-cond.  This patch fixes the
simpler issue that was found.

In Python 3, "int" and "long" are synonyms, so code like:

      else if (PyLong_Check (obj))
...
      else if (PyInt_Check (obj))

.... will trigger this warning.  The fix is to conditionalize the
PyInt_Check branches on Python 2.

Tested by rebuilding, with both version of Python, on x86-64 Fedora 24.

2016-09-20  Tom Tromey  <tom@tromey.com>

	* python/py-value.c (convert_value_from_python): Make PyInt_Check
	conditional on Python 2.
	* python/py-arch.c (archpy_disassemble): Make PyInt_Check
	conditional on Python 2.


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