Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Orgad Shaneh via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Orgad Shaneh <orgads@gmail.com>
Subject: [PATCH] sim/erc32: fix signedness compatiblity and redefinition warnings
Date: Wed, 27 Oct 2021 06:27:17 +0000	[thread overview]
Message-ID: <20211027062717.3056451-1-orgads@gmail.com> (raw)

---
 sim/erc32/func.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sim/erc32/func.c b/sim/erc32/func.c
index ff53f3bca51..9296831bcd9 100644
--- a/sim/erc32/func.c
+++ b/sim/erc32/func.c
@@ -31,6 +31,7 @@
 #include <sys/time.h>
 
 #define	VAL(x)	strtoul(x,(char **)NULL,0)
+void boot_init (void);
 
 struct disassemble_info dinfo;
 struct pstate   sregs;
@@ -747,7 +748,7 @@ static void print_insn_sparc_sis(uint32 addr, struct disassemble_info *info)
 {
     unsigned char           i[4];
 
-    sis_memory_read(addr, i, 4);
+    sis_memory_read(addr, (char *)i, 4);
     dinfo.buffer_vma = addr;
     dinfo.buffer_length = 4;
     dinfo.buffer = i;
@@ -779,7 +780,7 @@ disp_mem(uint32 addr, uint32 len)
 
     uint32          i;
     union {
-	    unsigned char u8[4];
+	    char b8[4];
 	    uint32 u32;
     } data;
     uint32          mem[4], j;
@@ -788,7 +789,7 @@ disp_mem(uint32 addr, uint32 len)
     for (i = addr & ~3; i < ((addr + len) & ~3); i += 16) {
 	printf("\n %8X  ", i);
 	for (j = 0; j < 4; j++) {
-	    sis_memory_read ((i + (j * 4)), data.u8, 4);
+	    sis_memory_read ((i + (j * 4)), data.b8, 4);
 	    printf ("%08x  ", data.u32);
 	    mem[j] = data.u32;
 	}
@@ -809,12 +810,12 @@ dis_mem(uint32 addr, uint32 len, struct disassemble_info *info)
 {
     uint32          i;
     union {
-	    unsigned char u8[4];
+	    char b8[4];
 	    uint32 u32;
     } data;
 
     for (i = addr & -3; i < ((addr & -3) + (len << 2)); i += 4) {
-	sis_memory_read (i, data.u8, 4);
+	sis_memory_read (i, data.b8, 4);
 	printf (" %08x  %08x  ", i, data.u32);
 	print_insn_sparc_sis(i, info);
         if (i >= 0xfffffffc) break;
@@ -996,7 +997,9 @@ sys_halt(void)
 #include "libiberty.h"
 #include "bfd.h"
 
+#ifndef min
 #define min(A, B) (((A) < (B)) ? (A) : (B))
+#endif
 #define LOAD_ADDRESS 0
 
 int
@@ -1068,7 +1071,7 @@ bfd_load (const char *fname)
 		fptr = 0;
 
 		while (section_size > 0) {
-		    char            buffer[1024];
+		    unsigned char   buffer[1024];
 		    int             count;
 
 		    count = min(section_size, 1024);
-- 
2.33.1.windows.1


             reply	other threads:[~2021-10-27  6:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  6:27 Orgad Shaneh via Gdb-patches [this message]
2021-10-27  9:37 ` Mike Frysinger via Gdb-patches
2021-10-28  7:55 ` Orgad Shaneh via Gdb-patches
2021-10-29  5:31   ` Mike Frysinger via Gdb-patches
2021-10-29  6:42 Orgad Shaneh via Gdb-patches

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=20211027062717.3056451-1-orgads@gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=orgads@gmail.com \
    /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