This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Avoid -Wduplicated-cond warnings in gdb/python
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Tue, 20 Sep 2016 13:02:40 -0400
- Subject: [binutils-gdb] Avoid -Wduplicated-cond warnings in gdb/python
- Authentication-results: sourceware.org; auth=none
*** 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.
- Follow-Ups:
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Debian-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Debian-s390x-native-gdbserver-m64, branch master
- Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Debian-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-native-gdbserver-m64, branch master
- Failures on Debian-i686-native-extended-gdbserver, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-native-gdbserver-m64, branch master