[PATCH/committed,08/20] sim: cris: fix -Wimplicit-fallthrough warnings

Message ID 20231221070127.19142-8-vapier@gentoo.org
State New
Headers
Series [PATCH/committed,01/20] sim: signal: mark signal callback funcs as noreturn since they don't return |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply

Commit Message

Mike Frysinger Dec. 21, 2023, 7:01 a.m. UTC
  Replace some fall through comments with the attribute.
---
 sim/cris/cris-tmpl.c | 4 ++++
 sim/cris/traps.c     | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c
index b39583cdb207..232085cf452e 100644
--- a/sim/cris/cris-tmpl.c
+++ b/sim/cris/cris-tmpl.c
@@ -67,6 +67,10 @@  MY (f_break_handler) (SIM_CPU *cpu, USI breaknum, USI pc)
       cris_break_13_handler (cpu, /* TARGET_SYS_exit */ 1, 0,
 			     0, 0, 0, 0, 0, pc);
 
+      /* This shouldn't be reached, but we can't mark break 13 as noreturn
+	 since there are some calls which should return.  */
+      ATTRIBUTE_FALLTHROUGH;
+
     default:
       abort ();
     }
diff --git a/sim/cris/traps.c b/sim/cris/traps.c
index 29b1b7cfdb38..cd4cfd9f0208 100644
--- a/sim/cris/traps.c
+++ b/sim/cris/traps.c
@@ -1527,7 +1527,7 @@  cris_break_13_handler (SIM_CPU *current_cpu, USI callnum, USI arg1,
 		  retval = TARGET_O_WRONLY;
 		  break;
 		}
-	      /* FALLTHROUGH */
+	      ATTRIBUTE_FALLTHROUGH;
 	    default:
 	      /* Nothing else is implemented.  */
 	      retval