Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 08/26] -Wpointer-sign: s390-tdep.c.
Date: Thu, 11 Apr 2013 23:01:00 -0000	[thread overview]
Message-ID: <20130411225954.16791.39934.stgit@brno.lan> (raw)
In-Reply-To: <20130411225847.16791.29283.stgit@brno.lan>

-Wpointer-sign reveals a bunch of:

../../src/gdb/s390-tdep.c:1342:7: error: pointer targets in passing argument 4 of ‘is_rx’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1038:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1343:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1344:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...
../../src/gdb/s390-tdep.c:1363:7: error: pointer targets in passing argument 5 of ‘is_rs’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:966:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1364:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1365:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...

I don't know much about s390, but from reading the code I believe the
right fix is to treat d2 as signed.

gdb/
2013-04-11  Pedro Alves  <palves@redhat.com>

	* s390-tdep.c (is_rs, is_rsy, is_rx, is_rxy): Change type of 'd2'
	parameter to int *.
---
 gdb/s390-tdep.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 50f8877..641bc80 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -964,7 +964,7 @@ is_rre (bfd_byte *insn, int op, unsigned int *r1, unsigned int *r2)
 
 static int
 is_rs (bfd_byte *insn, int op,
-       unsigned int *r1, unsigned int *r3, unsigned int *d2, unsigned int *b2)
+       unsigned int *r1, unsigned int *r3, int *d2, unsigned int *b2)
 {
   if (insn[0] == op)
     {
@@ -981,7 +981,7 @@ is_rs (bfd_byte *insn, int op,
 
 static int
 is_rsy (bfd_byte *insn, int op1, int op2,
-        unsigned int *r1, unsigned int *r3, unsigned int *d2, unsigned int *b2)
+        unsigned int *r1, unsigned int *r3, int *d2, unsigned int *b2)
 {
   if (insn[0] == op1
       && insn[5] == op2)
@@ -1036,7 +1036,7 @@ is_rie (bfd_byte *insn, int op1, int op2,
 
 static int
 is_rx (bfd_byte *insn, int op,
-       unsigned int *r1, unsigned int *d2, unsigned int *x2, unsigned int *b2)
+       unsigned int *r1, int *d2, unsigned int *x2, unsigned int *b2)
 {
   if (insn[0] == op)
     {
@@ -1053,7 +1053,7 @@ is_rx (bfd_byte *insn, int op,
 
 static int
 is_rxy (bfd_byte *insn, int op1, int op2,
-        unsigned int *r1, unsigned int *d2, unsigned int *x2, unsigned int *b2)
+        unsigned int *r1, int *d2, unsigned int *x2, unsigned int *b2)
 {
   if (insn[0] == op1
       && insn[5] == op2)


  parent reply	other threads:[~2013-04-11 22:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 06/26] mips-tdep.c: Wrong signness for local holding PC register 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 ` Pedro Alves [this message]
2013-04-11 23:01 ` [PATCH 10/26] -Wpointer-sign: xtensa-tdep.c 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 03/26] cris-tdep.c: Use unsigned variable for unsigned command 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 05/26] mep-tdep.c: Wrong signness for instruction buffer Pedro Alves
2013-04-11 23:02 ` [PATCH 11/26] -Wpointer-sign: alpha-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: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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130411225954.16791.39934.stgit@brno.lan \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox