public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/9] sim: or1k: build with -Werror
@ 2021-11-01  4:59 Mike Frysinger
  2021-11-01  4:59 ` [PATCH 2/9] sim: sh: reduce -Wno-error scope Mike Frysinger
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

The only warnings left in this port are a few maybe-uninitialized,
but we don't abort the build for them, so turn on -Werror everywhere.
---
 sim/or1k/Makefile.in | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index 8f447fdc291a..c6bd03b756cd 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -55,9 +55,6 @@ SIM_EXTRA_LIBS = -lm
 
 SIM_EXTRA_CLEAN = or1k-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = or1k
-- 
2.33.0


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

* [PATCH 2/9] sim: sh: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 3/9] sim: cris: " Mike Frysinger
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Only one file in here still generates warnings, so reduce the -Werror
disable to that alone now that we require GNU make and can set variables
on a per-object basis.
---
 sim/sh/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index efac41e8a401..e79efd1ff5e2 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -28,8 +28,8 @@ SIM_EXTRA_LIBS = -lm
 SIM_EXTRA_CLEAN = sh-clean
 SIM_EXTRA_DEPS = table.c code.c ppi.c
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+interp.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
-- 
2.33.0


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

* [PATCH 3/9] sim: cris: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
  2021-11-01  4:59 ` [PATCH 2/9] sim: sh: reduce -Wno-error scope Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 4/9] sim: erc32: " Mike Frysinger
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Only two files in here still generates warnings, so reduce the -Werror
disable to that now that we require GNU make and can set variables on
a per-object basis.
---
 sim/cris/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 6125fc87bedc..18dd2f451b55 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -41,8 +41,8 @@ SIM_EXTRA_DEPS = \
 
 SIM_EXTRA_CLEAN = cris-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+crisv10f.o crisv32f.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
-- 
2.33.0


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

* [PATCH 4/9] sim: erc32: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
  2021-11-01  4:59 ` [PATCH 2/9] sim: sh: reduce -Wno-error scope Mike Frysinger
  2021-11-01  4:59 ` [PATCH 3/9] sim: cris: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 5/9] sim: mips: " Mike Frysinger
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Only one file in here still generates warnings, so reduce the -Werror
disable to that alone now that we require GNU make and can set variables
on a per-object basis.
---
 sim/erc32/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index 130220e52fe6..613f9faf0bd5 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -32,8 +32,8 @@ SIM_EXTRA_CLEAN = clean-sis
 # behaviour of UART interrupt routines ...
 SIM_EXTRA_CFLAGS += -DFAST_UART -I$(srcroot)
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+exec.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
-- 
2.33.0


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

* [PATCH 5/9] sim: mips: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (2 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 4/9] sim: erc32: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 6/9] sim: m32r: " Mike Frysinger
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Fix a few printf warnings in sim-main.c, and then we're left with only
one file in here still generating warnings, so reduce the -Werror
disable to that alone now that we require GNU make and can set variables
on a per-object basis.
---
 sim/mips/Makefile.in |  4 ++--
 sim/mips/sim-main.c  | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 632cc20f3a8b..b34fdf5b461e 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -77,8 +77,8 @@ all: $(SIM_@sim_gen@_ALL)
 
 SIM_EXTRA_DEPS = itable.h
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+cp1.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/mips/sim-main.c b/sim/mips/sim-main.c
index 24e16029d22e..1b9be9567aa0 100644
--- a/sim/mips/sim-main.c
+++ b/sim/mips/sim-main.c
@@ -422,11 +422,11 @@ pending_tick (SIM_DESC SD,
 	      if (PENDING_SLOT_DELAY[index] == 0)			
 		{							
 		  if (PENDING_TRACE)
-		    sim_io_eprintf (SD, "PENDING_DRAIN - drained - index %d, dest 0x%lx, bit %d, val 0x%lx, size %d\n",
+		    sim_io_eprintf (SD, "PENDING_DRAIN - drained - index %d, dest %p, bit %d, val %" PRIx64 ", size %d\n",
 				    index,
-				    (unsigned long) PENDING_SLOT_DEST[index],
+				    PENDING_SLOT_DEST[index],
 				    PENDING_SLOT_BIT[index],
-				    (unsigned long) PENDING_SLOT_VALUE[index],
+				    PENDING_SLOT_VALUE[index],
 				    PENDING_SLOT_SIZE[index]);
 		  if (PENDING_SLOT_BIT[index] >= 0)			
 		    switch (PENDING_SLOT_SIZE[index])                 
@@ -468,11 +468,11 @@ pending_tick (SIM_DESC SD,
 		    }
 		}							
 	      else if (PENDING_TRACE && PENDING_SLOT_DELAY[index] > 0)
-		sim_io_eprintf (SD, "PENDING_DRAIN - queued - index %d, delay %d, dest 0x%lx, bit %d, val 0x%lx, size %d\n",
+		sim_io_eprintf (SD, "PENDING_DRAIN - queued - index %d, delay %d, dest %p, bit %d, val %" PRIx64 ", size %d\n",
 				index, PENDING_SLOT_DELAY[index],
-				(unsigned long) PENDING_SLOT_DEST[index],
+				PENDING_SLOT_DEST[index],
 				PENDING_SLOT_BIT[index],
-				(unsigned long) PENDING_SLOT_VALUE[index],
+				PENDING_SLOT_VALUE[index],
 				PENDING_SLOT_SIZE[index]);
 
 	    }								
-- 
2.33.0


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

* [PATCH 6/9] sim: m32r: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (3 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 5/9] sim: mips: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 7/9] sim: frv: " Mike Frysinger
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Only two files in here still generates warnings, so reduce the -Werror
disable to that now that we require GNU make and can set variables on
a per-object basis.
---
 sim/m32r/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 7b0ed1e0b932..d9d8acfc30fd 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -43,8 +43,8 @@ SIM_EXTRA_DEPS = \
 
 SIM_EXTRA_CLEAN = m32r-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-if.o traps.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
-- 
2.33.0


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

* [PATCH 7/9] sim: frv: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (4 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 6/9] sim: m32r: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 8/9] sim: lm32: " Mike Frysinger
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Only two files in here still generates warnings, so reduce the -Werror
disable to that now that we require GNU make and can set variables on
a per-object basis.
---
 sim/frv/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index e709e37ee740..2c17075432c6 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -40,8 +40,8 @@ SIM_EXTRA_CFLAGS = @SIM_FRV_TRAPDUMP_FLAGS@
 
 SIM_EXTRA_CLEAN = frv-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+memory.o sem.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
-- 
2.33.0


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

* [PATCH 8/9] sim: lm32: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (5 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 7/9] sim: frv: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-01  4:59 ` [PATCH 9/9] sim: iq2000: " Mike Frysinger
  2021-11-03  4:09 ` [PATCH 1/9] sim: or1k: build with -Werror Simon Marchi
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Clean up some warnings in dv-lm32cpu, and all in sim-if, then reduce
the -Werror disable to the files that still aren't clean that now that
we require GNU make and can set variables on a per-object basis.
---
 sim/lm32/Makefile.in  | 4 ++--
 sim/lm32/dv-lm32cpu.c | 2 +-
 sim/lm32/sim-if.c     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index 2daf74d637bc..642c483acd26 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -24,8 +24,8 @@ SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h \
 
 SIM_EXTRA_CLEAN = lm32-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+dv-lm32cpu.o mloop.o sem.o traps.o user.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/lm32/dv-lm32cpu.c b/sim/lm32/dv-lm32cpu.c
index 2f702bd72295..83fe6078b0b8 100644
--- a/sim/lm32/dv-lm32cpu.c
+++ b/sim/lm32/dv-lm32cpu.c
@@ -141,7 +141,7 @@ deliver_lm32cpu_interrupt (struct hw *me, void *data)
   SIM_DESC sd = hw_system (me);
   sim_cpu *cpu = STATE_CPU (sd, 0);	/* NB: fix CPU 0.  */
   address_word cia = CPU_PC_GET (cpu);
-  int interrupt = (int) data;
+  int interrupt = (uintptr_t) data;
 
 
   HW_TRACE ((me, "interrupt-check event"));
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index f9143ea00375..2f8b3449917a 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -158,8 +158,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 	      free_state (sd);
 	      return 0;
 	    }
-	  /*sim_io_printf (sd, "Allocating memory at 0x%x size 0x%x\n", base, limit); */
-	  sim_do_commandf (sd, "memory region 0x%x,0x%x", base, limit);
+	  /*sim_io_printf (sd, "Allocating memory at 0x%lx size 0x%lx\n", base, limit); */
+	  sim_do_commandf (sd, "memory region 0x%lx,0x%lx", base, limit);
 	}
     }
 
-- 
2.33.0


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

* [PATCH 9/9] sim: iq2000: reduce -Wno-error scope
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (6 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 8/9] sim: lm32: " Mike Frysinger
@ 2021-11-01  4:59 ` Mike Frysinger
  2021-11-03  4:09 ` [PATCH 1/9] sim: or1k: build with -Werror Simon Marchi
  8 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger @ 2021-11-01  4:59 UTC (permalink / raw)
  To: gdb-patches

Clean up the warnings in sim-if, then reduce the -Werror disable to
the files that still aren't clean that now that we require GNU make
and can set variables on a per-object basis.
---
 sim/iq2000/Makefile.in | 4 ++--
 sim/iq2000/sim-if.c    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index 4f85dc762358..b47d15ac4772 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -37,8 +37,8 @@ ALL_CPU_CFLAGS = -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF
 
 SIM_EXTRA_CLEAN = iq2000-clean
 
-# Code doesn't build cleanly yet.
-SIM_WERROR_CFLAGS =
+# Some modules don't build cleanly yet.
+cpu.o iq2000.o mloop.o sem.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c
index 9728882dac51..8cfc1e0ca3e6 100644
--- a/sim/iq2000/sim-if.c
+++ b/sim/iq2000/sim-if.c
@@ -32,7 +32,7 @@ static void free_state (SIM_DESC);
 \f
 /* Cover function for sim_cgen_disassemble_insn.  */
 
-void
+static void
 iq2000bf_disassemble_insn (SIM_CPU *cpu, const CGEN_INSN *insn,
 			  const ARGBUF *abuf, IADDR pc, char *buf)
 {
@@ -89,8 +89,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
     }
 
   /* Allocate core managed memory.  */
-  sim_do_commandf (sd, "memory region 0x%lx,0x%lx", IQ2000_INSN_VALUE, IQ2000_INSN_MEM_SIZE); 
-  sim_do_commandf (sd, "memory region 0x%lx,0x%lx", IQ2000_DATA_VALUE, IQ2000_DATA_MEM_SIZE); 
+  sim_do_commandf (sd, "memory region 0x%x,0x%x", IQ2000_INSN_VALUE, IQ2000_INSN_MEM_SIZE); 
+  sim_do_commandf (sd, "memory region 0x%x,0x%x", IQ2000_DATA_VALUE, IQ2000_DATA_MEM_SIZE); 
 
   /* check for/establish the reference program image */
   if (sim_analyze_program (sd,
-- 
2.33.0


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

* Re: [PATCH 1/9] sim: or1k: build with -Werror
  2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
                   ` (7 preceding siblings ...)
  2021-11-01  4:59 ` [PATCH 9/9] sim: iq2000: " Mike Frysinger
@ 2021-11-03  4:09 ` Simon Marchi
  2021-11-03  5:19   ` Mike Frysinger
  8 siblings, 1 reply; 12+ messages in thread
From: Simon Marchi @ 2021-11-03  4:09 UTC (permalink / raw)
  To: Mike Frysinger, gdb-patches

On 2021-11-01 00:59, Mike Frysinger via Gdb-patches wrote:
> The only warnings left in this port are a few maybe-uninitialized,
> but we don't abort the build for them, so turn on -Werror everywhere.
> ---
>  sim/or1k/Makefile.in | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
> index 8f447fdc291a..c6bd03b756cd 100644
> --- a/sim/or1k/Makefile.in
> +++ b/sim/or1k/Makefile.in
> @@ -55,9 +55,6 @@ SIM_EXTRA_LIBS = -lm
>  
>  SIM_EXTRA_CLEAN = or1k-clean
>  
> -# Code doesn't build cleanly yet.
> -SIM_WERROR_CFLAGS =
> -
>  ## COMMON_POST_CONFIG_FRAG
>  
>  arch = or1k
> 

Hi,

I get:

make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/or1k'
ccache gcc  -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_ADDRESS_BITSIZE=32  -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -Werror  -I. -I/home/simark/src/binutils-gdb/sim/or1k -I../common -I/home/simark/src/binutils-gdb/sim/or1k/../common -I../../include -I/home/simark/src/binutils-gdb/sim/or1k/../../include -I../../bfd -I/home/simark/src/binutils-gdb/sim/or1k/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/or1k/../../opcodes -I../..  -I/home/simark/src/binutils-gdb/sim/or1k/../../gnulib/import -I../../gnulib/import  -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always   -c -o mloop.o -MT mloop.o -MMD -MP -MF .deps/mloop.Tpo mloop.c
mloop.c:65:1: error: ‘or1k32bf_emit_after’ defined but not used [-Werror=unused-function]
   65 | or1k32bf_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc)
      | ^~~~~~~~~~~~~~~~~~~


Simon

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

* Re: [PATCH 1/9] sim: or1k: build with -Werror
  2021-11-03  4:09 ` [PATCH 1/9] sim: or1k: build with -Werror Simon Marchi
@ 2021-11-03  5:19   ` Mike Frysinger
  2021-11-03 14:11     ` Simon Marchi
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Frysinger @ 2021-11-03  5:19 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 4403 bytes --]

On 03 Nov 2021 00:09, Simon Marchi wrote:
> On 2021-11-01 00:59, Mike Frysinger via Gdb-patches wrote:
> > The only warnings left in this port are a few maybe-uninitialized,
> > but we don't abort the build for them, so turn on -Werror everywhere.
> > ---
> >  sim/or1k/Makefile.in | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
> > index 8f447fdc291a..c6bd03b756cd 100644
> > --- a/sim/or1k/Makefile.in
> > +++ b/sim/or1k/Makefile.in
> > @@ -55,9 +55,6 @@ SIM_EXTRA_LIBS = -lm
> >  
> >  SIM_EXTRA_CLEAN = or1k-clean
> >  
> > -# Code doesn't build cleanly yet.
> > -SIM_WERROR_CFLAGS =
> > -
> 
> make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/or1k'
> ccache gcc  -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_ADDRESS_BITSIZE=32  -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -Werror  -I. -I/home/simark/src/binutils-gdb/sim/or1k -I../common -I/home/simark/src/binutils-gdb/sim/or1k/../common -I../../include -I/home/simark/src/binutils-gdb/sim/or1k/../../include -I../../bfd -I/home/simark/src/binutils-gdb/sim/or1k/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/or1k/../../opcodes -I../..  -I/home/simark/src/binutils-gdb/sim/or1k/../../gnulib/import -I../../gnulib/import  -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always   -c -o mloop.o -MT mloop.o -MMD -MP -MF .deps/mloop.Tpo mloop.c
> mloop.c:65:1: error: ‘or1k32bf_emit_after’ defined but not used [-Werror=unused-function]
>    65 | or1k32bf_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc)
>       | ^~~~~~~~~~~~~~~~~~~

thanks for the heads up.  easy to fix, but super annoying how gcc doesn't
throw this error w/-O2 or anything higher than -O0.  i fixed all the ones
that showed up in my -O0 multibuild.

(ノ°Д°)ノ︵ ᴚƎᴎI⅂ᴎI
-mike

From 187a6c67c927087f791b420ed599d4003b9ac530 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Wed, 3 Nov 2021 01:17:17 -0400
Subject: [PATCH] sim: mloop: mark a few conditionally used funcs as unused

These are marked inline, so building w/gcc at higher optimization
levels will automatically discard them.  But building with -O0 will
trigger unused function warnings, so fix that.

The common before/after cover functions in the common mloop generator
are not used by all architecture ports.  Doesn't seem to be a hard
requirement, so marking them optional (i.e. unused) is fine.

The cris execute function is conditionally used depending on the
fast-build mode settings, so mark it unused too.
---
 sim/common/genmloop.sh | 4 ++--
 sim/cris/mloop.in      | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index 572dc8a9ed4b..b8a0f435a09b 100755
--- a/sim/common/genmloop.sh
+++ b/sim/common/genmloop.sh
@@ -349,7 +349,7 @@ static INLINE void
    This is as opposed to x-after which is only emitted at the end of a group
    of parallel insns.  */
 
-static INLINE void
+ATTRIBUTE_UNUSED static INLINE void
 @prefix@_emit_before (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc, int first_p)
 {
   ARGBUF *abuf = &sc[0].argbuf;
@@ -364,7 +364,7 @@ static INLINE void
    x-after is emitted after a serial insn or at the end of a group of
    parallel insns.  */
 
-static INLINE void
+ATTRIBUTE_UNUSED static INLINE void
 @prefix@_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc)
 {
   ARGBUF *abuf = &sc[0].argbuf;
diff --git a/sim/cris/mloop.in b/sim/cris/mloop.in
index 645d82116069..da800e745afd 100644
--- a/sim/cris/mloop.in
+++ b/sim/cris/mloop.in
@@ -67,7 +67,8 @@ extract (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_INT insn, ARGBUF *abuf,
   return id;
 }
 
-static INLINE SEM_PC
+/* This might not be used directly depending on the fast compile mode.  */
+ATTRIBUTE_UNUSED static INLINE SEM_PC
 execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
 {
   SEM_PC vpc;
-- 
2.33.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/9] sim: or1k: build with -Werror
  2021-11-03  5:19   ` Mike Frysinger
@ 2021-11-03 14:11     ` Simon Marchi
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Marchi @ 2021-11-03 14:11 UTC (permalink / raw)
  To: gdb-patches

On 2021-11-03 1:19 a.m., Mike Frysinger wrote:
> On 03 Nov 2021 00:09, Simon Marchi wrote:
>> On 2021-11-01 00:59, Mike Frysinger via Gdb-patches wrote:
>>> The only warnings left in this port are a few maybe-uninitialized,
>>> but we don't abort the build for them, so turn on -Werror everywhere.
>>> ---
>>>  sim/or1k/Makefile.in | 3 ---
>>>  1 file changed, 3 deletions(-)
>>>
>>> diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
>>> index 8f447fdc291a..c6bd03b756cd 100644
>>> --- a/sim/or1k/Makefile.in
>>> +++ b/sim/or1k/Makefile.in
>>> @@ -55,9 +55,6 @@ SIM_EXTRA_LIBS = -lm
>>>  
>>>  SIM_EXTRA_CLEAN = or1k-clean
>>>  
>>> -# Code doesn't build cleanly yet.
>>> -SIM_WERROR_CFLAGS =
>>> -
>>
>> make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/or1k'
>> ccache gcc  -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_ADDRESS_BITSIZE=32  -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -Werror  -I. -I/home/simark/src/binutils-gdb/sim/or1k -I../common -I/home/simark/src/binutils-gdb/sim/or1k/../common -I../../include -I/home/simark/src/binutils-gdb/sim/or1k/../../include -I../../bfd -I/home/simark/src/binutils-gdb/sim/or1k/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/or1k/../../opcodes -I../..  -I/home/simark/src/binutils-gdb/sim/or1k/../../gnulib/import -I../../gnulib/import  -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always   -c -o mloop.o -MT mloop.o -MMD -MP -MF .deps/mloop.Tpo mloop.c
>> mloop.c:65:1: error: ‘or1k32bf_emit_after’ defined but not used [-Werror=unused-function]
>>    65 | or1k32bf_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc)
>>       | ^~~~~~~~~~~~~~~~~~~
> 
> thanks for the heads up.  easy to fix, but super annoying how gcc doesn't
> throw this error w/-O2 or anything higher than -O0.  i fixed all the ones
> that showed up in my -O0 multibuild.
> 
> (ノ°Д°)ノ︵ ᴚƎᴎI⅂ᴎI
> -mike


Hehe, thanks.

Simon


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

end of thread, other threads:[~2021-11-03 14:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01  4:59 [PATCH 1/9] sim: or1k: build with -Werror Mike Frysinger
2021-11-01  4:59 ` [PATCH 2/9] sim: sh: reduce -Wno-error scope Mike Frysinger
2021-11-01  4:59 ` [PATCH 3/9] sim: cris: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 4/9] sim: erc32: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 5/9] sim: mips: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 6/9] sim: m32r: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 7/9] sim: frv: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 8/9] sim: lm32: " Mike Frysinger
2021-11-01  4:59 ` [PATCH 9/9] sim: iq2000: " Mike Frysinger
2021-11-03  4:09 ` [PATCH 1/9] sim: or1k: build with -Werror Simon Marchi
2021-11-03  5:19   ` Mike Frysinger
2021-11-03 14:11     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).