Avoid -Wduplicated-cond warnings in gdb/python
authorTom Tromey <tom@tromey.com>
Thu, 21 Jul 2016 19:41:54 +0000 (13:41 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 20 Sep 2016 16:35:27 +0000 (10:35 -0600)
commit12c58cd4dc805cbac97a6d93c971c2496313dce4
treebd8f42f27c92257815d2b0874c1a0e574534996c
parent9f7efd5bf76aa5065298d13aefb109ecfd7a825a
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.
gdb/ChangeLog
gdb/python/py-arch.c
gdb/python/py-value.c
This page took 0.024416 seconds and 4 git commands to generate.