Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 00/26] Make GDB -Wpointer-sign clean.
@ 2013-04-11 23:00 Pedro Alves
  2013-04-11 23:00 ` [PATCH 01/26] -Wpointer-sign: char -> gdb_byte Pedro Alves
                   ` (28 more replies)
  0 siblings, 29 replies; 39+ messages in thread
From: Pedro Alves @ 2013-04-11 23:00 UTC (permalink / raw)
  To: gdb-patches

(I started out writting this a few weeks ago, and pushed out some
bits, but I hadn't managed to get to travel the last mile and properly
split it and write descriptions/logs.  I did it now in order to avoid
having it fall into further bitrot decay.)

This makes GDB -Wpointer-sign clean on x86_64 GNU/Linux,
--enable-targets=all.  Once this is in, and perhaps a couple hosts
more are clean too (mingw and i386 GNU/Linux at least; haven't tried
those), I'll propose enabling the switch by default.

The main idea came out as reviewing a new port a few months ago, and
pointing out for the Nth time to use gdb_byte[] instead of char[].
The bad uses were of course coming in through copy/paste, so at the
time I grepped and fixed all I found.  Later, I noticed that
-Wpointer-sign catches these issues, as gdb_byte is unsigned char
while char is signed on x86_64, so it'd be good to enable that switch.
Of course, before that, we need to fix all current issues in the tree,
hence the previous patches from a few weeks back and now this series.

This is mostly split by category, with the first patches touching the
whole codebase, fixing each a class of issues.  Latter patches in the
series fix the remaining issues in individual files, when their fixes
are either non-obvious, or don't fit in the class of a previous patch.

I'm hoping this sort of split makes review easy and allows quick
turnaround as consequence.

Tested on x86_64 Fedora 17.

For convenience, you can also find this series at:

 git@github.com:palves/gdb.git Wpointer-sign
 https://github.com/palves/gdb/commits/Wpointer-sign

---

Pedro Alves (26):
      -Wpointer-sign: char -> gdb_byte.
      -Wpointer-sign: gdb_byte -> char.
      cris-tdep.c: Use unsigned variable for unsigned command.
      alpha-tdep.c/mips-tdep.c: "set heuristic-fence-post" is signed/zinteger.
      mep-tdep.c: Wrong signness for instruction buffer.
      mips-tdep.c: Wrong signness for local holding PC register.
      ppc-linux-tdep.c: Wrong signness for buffer holding instructions.
      -Wpointer-sign: s390-tdep.c.
      -Wpointer-sign: aarch64-tdep.c.
      -Wpointer-sign: xtensa-tdep.c.
      -Wpointer-sign: alpha-tdep.c.
      Cast result of obstack_base to gdb_byte * in a couple spots.
      serial_write: change prototype to take a void-pointer buffer.
      gdb_byte for binary buffer, char for string: remote.c, tracepoint.c.
      gdb_byte for binary buffer, char for string: common/agent.c.
      -Wpointer-sign: remote-mips.c.
      -Wpointer-sign: python/.
      -Wpointer-sign: bookmarks.
      -Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as char *.
      -Wpointer-sign: xcoffread.c.
      -Wpointer-sign: dwarf2read.c.
      -Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128.
      -Wpointer-sign: ada-lang.c, ada-tasks.c.
      -Wpointer-sign: cp-valprint.c.
      -Wpointer-sign: ctf.c.
      -Wpointer-sign: record.c.


 gdb/aarch64-tdep.c           |    6 +++---
 gdb/ada-lang.c               |    5 +++--
 gdb/ada-tasks.c              |    2 +-
 gdb/alpha-tdep.c             |    6 +++---
 gdb/alphanbsd-tdep.c         |    8 ++++----
 gdb/arm-linux-tdep.c         |   16 ++++++++-------
 gdb/arm-tdep.c               |   12 ++++++-----
 gdb/arm-tdep.h               |    6 +++---
 gdb/arm-wince-tdep.c         |    4 ++--
 gdb/armnbsd-tdep.c           |    8 ++++----
 gdb/armobsd-tdep.c           |    4 ++--
 gdb/avr-tdep.c               |    8 +++++---
 gdb/c-lang.c                 |    2 +-
 gdb/coff-pe-read.c           |    7 ++++---
 gdb/common/agent.c           |    3 ++-
 gdb/cp-valprint.c            |    2 +-
 gdb/cris-tdep.c              |   26 ++++++++++++-------------
 gdb/ctf.c                    |   15 ++++++++------
 gdb/dwarf2-frame.c           |    6 +++---
 gdb/dwarf2loc.c              |    4 ++--
 gdb/dwarf2read.c             |   10 +++++-----
 gdb/frv-tdep.c               |   10 +++++-----
 gdb/hppa-hpux-tdep.c         |   16 ++++++++-------
 gdb/hppa-tdep.c              |    4 ++--
 gdb/i386-cygwin-tdep.c       |    6 +++---
 gdb/i387-tdep.c              |    2 +-
 gdb/ia64-tdep.c              |   24 +++++++++++------------
 gdb/linux-tdep.c             |    8 ++++----
 gdb/m32c-tdep.c              |    3 +--
 gdb/m68hc11-tdep.c           |   14 +++++++------
 gdb/mep-tdep.c               |    2 +-
 gdb/mips-tdep.c              |    6 +++---
 gdb/mipsnbsd-tdep.c          |    2 +-
 gdb/mn10300-tdep.c           |   11 ++++++-----
 gdb/moxie-tdep.c             |   14 +++++--------
 gdb/ppc-linux-tdep.c         |    2 +-
 gdb/ppc-ravenscar-thread.c   |    6 +++---
 gdb/python/py-inferior.c     |    2 +-
 gdb/python/py-prettyprint.c  |   10 +++++-----
 gdb/python/py-value.c        |    3 ++-
 gdb/ravenscar-thread.c       |    2 +-
 gdb/record-full.c            |   10 ++++++----
 gdb/record.c                 |    2 +-
 gdb/remote-m32r-sdi.c        |    2 +-
 gdb/remote-mips.c            |   34 +++++++++++++++++---------------
 gdb/remote.c                 |   31 +++++++++++++++---------------
 gdb/reverse.c                |    4 ++--
 gdb/s390-tdep.c              |    8 ++++----
 gdb/score-tdep.c             |    2 +-
 gdb/ser-base.c               |   11 ++++++-----
 gdb/ser-base.h               |    2 +-
 gdb/ser-go32.c               |   13 +++++++-----
 gdb/serial.c                 |   16 +++++++++------
 gdb/serial.h                 |    6 +++---
 gdb/sh-tdep.c                |   44 +++++++++++++++++++++---------------------
 gdb/sh64-tdep.c              |   41 ++++++++++++++++++---------------------
 gdb/solib-darwin.c           |   10 +++++-----
 gdb/solib-dsbt.c             |    4 ++--
 gdb/solib-frv.c              |    4 ++--
 gdb/solib-irix.c             |   12 ++++++-----
 gdb/solib-som.c              |    2 +-
 gdb/solib-spu.c              |    2 +-
 gdb/solib-svr4.c             |    6 +++---
 gdb/sparc-ravenscar-thread.c |    6 +++---
 gdb/spu-multiarch.c          |    2 +-
 gdb/spu-tdep.c               |   18 ++++++++++-------
 gdb/tic6x-tdep.c             |    2 +-
 gdb/tic6x-tdep.h             |    2 +-
 gdb/tracepoint.c             |   19 ++++++++++--------
 gdb/xcoffread.c              |    2 +-
 gdb/xstormy16-tdep.c         |   10 +++++-----
 gdb/xtensa-tdep.c            |   10 +++++-----
 72 files changed, 328 insertions(+), 316 deletions(-)

-- 
Signature


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2013-04-19 15:40 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-11 23:00 [PATCH 00/26] Make GDB -Wpointer-sign clean Pedro Alves
2013-04-11 23:00 ` [PATCH 01/26] -Wpointer-sign: char -> gdb_byte Pedro Alves
2013-04-11 23:00 ` [PATCH 02/26] -Wpointer-sign: gdb_byte -> char Pedro Alves
2013-04-12 12:34   ` Yao Qi
2013-04-12 14:42     ` Pedro Alves
2013-04-11 23:01 ` [PATCH 03/26] cris-tdep.c: Use unsigned variable for unsigned command Pedro Alves
2013-04-11 23:01 ` [PATCH 07/26] ppc-linux-tdep.c: Wrong signness for buffer holding instructions Pedro Alves
2013-04-11 23:01 ` [PATCH 05/26] mep-tdep.c: Wrong signness for instruction buffer Pedro Alves
2013-04-11 23:01 ` [PATCH 04/26] alpha-tdep.c/mips-tdep.c: "set heuristic-fence-post" is signed/zinteger Pedro Alves
2013-04-11 23:01 ` [PATCH 12/26] Cast result of obstack_base to gdb_byte * in a couple spots Pedro Alves
2013-04-11 23:01 ` [PATCH 06/26] mips-tdep.c: Wrong signness for local holding PC register Pedro Alves
2013-04-11 23:01 ` [PATCH 10/26] -Wpointer-sign: xtensa-tdep.c Pedro Alves
2013-04-11 23:01 ` [PATCH 08/26] -Wpointer-sign: s390-tdep.c Pedro Alves
2013-04-11 23:02 ` [PATCH 13/26] serial_write: change prototype to take a void-pointer buffer Pedro Alves
2013-04-12 14:55   ` Pedro Alves
2013-04-19 14:23     ` Pedro Alves
2013-04-19 14:28       ` Eli Zaretskii
2013-04-19 14:28         ` Pedro Alves
2013-04-11 23:02 ` [PATCH 11/26] -Wpointer-sign: alpha-tdep.c Pedro Alves
2013-04-11 23:20 ` [PATCH 14/26] gdb_byte for binary buffer, char for string: remote.c, tracepoint.c Pedro Alves
2013-04-11 23:23 ` [PATCH 15/26] gdb_byte for binary buffer, char for string: common/agent.c Pedro Alves
2013-04-12  2:30 ` [PATCH 16/26] -Wpointer-sign: remote-mips.c Pedro Alves
2013-04-12  2:32 ` [PATCH 17/26] -Wpointer-sign: python/ Pedro Alves
2013-04-12 20:56   ` Tom Tromey
2013-04-12  6:55 ` [PATCH 18/26] -Wpointer-sign: bookmarks Pedro Alves
2013-04-12  8:58 ` [PATCH 19/26] -Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as char * Pedro Alves
2013-04-12  9:06 ` [PATCH 20/26] -Wpointer-sign: xcoffread.c Pedro Alves
2013-04-12  9:32 ` [PATCH 21/26] -Wpointer-sign: dwarf2read.c Pedro Alves
2013-04-12 21:01   ` Tom Tromey
2013-04-12  9:54 ` [PATCH 22/26] -Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128 Pedro Alves
2013-04-12 10:01 ` [PATCH 23/26] -Wpointer-sign: ada-lang.c, ada-tasks.c Pedro Alves
2013-04-12 10:11 ` [PATCH 24/26] -Wpointer-sign: cp-valprint.c Pedro Alves
2013-04-12 10:18 ` [PATCH 25/26] -Wpointer-sign: ctf.c Pedro Alves
2013-04-12 10:39 ` [PATCH 26/26] -Wpointer-sign: record.c Pedro Alves
2013-04-12 11:34 ` [PATCH 09/26] -Wpointer-sign: aarch64-tdep.c Pedro Alves
2013-04-12 14:39 ` [PATCH 00/26] Make GDB -Wpointer-sign clean Yao Qi
2013-04-12 21:44 ` Tom Tromey
2013-04-19 14:13   ` Pedro Alves
2013-04-19 18:17 ` [COMMIT] " Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox