public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed 05/20] sim: arm: fix -Wimplicit-fallthrough warnings
Date: Thu, 21 Dec 2023 02:01:12 -0500	[thread overview]
Message-ID: <20231221070127.19142-5-vapier@gentoo.org> (raw)
In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org>

Replace some fall through comments with the attribute.
---
 sim/arm/armemu.c   | 6 +++---
 sim/arm/armos.c    | 1 +
 sim/arm/thumbemu.c | 7 ++++---
 sim/arm/wrapper.c  | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/sim/arm/armemu.c b/sim/arm/armemu.c
index ab7454628ba0..2b8ae007cb56 100644
--- a/sim/arm/armemu.c
+++ b/sim/arm/armemu.c
@@ -4388,7 +4388,7 @@ check_PMUintr:
 		    ARMul_UndefInstr (state, instr);
 		  break;
 		}
-	      /* Drop through.  */
+	      ATTRIBUTE_FALLTHROUGH;
 
 	    case 0xc0:		/* Store , No WriteBack , Post Dec.  */
 	      ARMul_STC (state, instr, LHS);
@@ -4435,7 +4435,7 @@ check_PMUintr:
 		    ARMul_UndefInstr (state, instr);
 		  break;
 		}
-	      /* Drop through.  */
+	      ATTRIBUTE_FALLTHROUGH;
 
 	    case 0xc1:		/* Load , No WriteBack , Post Dec.  */
 	      ARMul_LDC (state, instr, LHS);
@@ -4622,7 +4622,7 @@ check_PMUintr:
 		  default:
 		    break;
 		  }
-	      /* Drop through.  */
+	      ATTRIBUTE_FALLTHROUGH;
 
 	    case 0xe0:
 	    case 0xe4:
diff --git a/sim/arm/armos.c b/sim/arm/armos.c
index 374861d7a5ec..6deb722d204d 100644
--- a/sim/arm/armos.c
+++ b/sim/arm/armos.c
@@ -832,6 +832,7 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number)
 	    }
 	  break;
 	}
+      ATTRIBUTE_FALLTHROUGH;
 
     default:
       unhandled = TRUE;
diff --git a/sim/arm/thumbemu.c b/sim/arm/thumbemu.c
index 6915d23ec4cc..99f51ef34691 100644
--- a/sim/arm/thumbemu.c
+++ b/sim/arm/thumbemu.c
@@ -308,7 +308,7 @@ handle_T2_insn (ARMul_State * state,
 	  * pvalid = t_branch;
 	  break;
 	}
-      /* Fall through.  */
+      ATTRIBUTE_FALLTHROUGH;
     case 0x42:
     case 0x43:
     case 0x47:
@@ -2261,7 +2261,7 @@ ARMul_ThumbDecode (ARMul_State * state,
 		    | ((tinstr & 0x0078) >> 3);	/* Rd */
 		  break;
 		}
-	      /* Drop through.  */
+	      ATTRIBUTE_FALLTHROUGH;
 	    default:
 	    case 0x0:		/* UNDEFINED */
 	    case 0x4:		/* UNDEFINED */
@@ -2415,7 +2415,7 @@ ARMul_ThumbDecode (ARMul_State * state,
 		* ainstr = 0xE1200070 | ((tinstr & 0xf0) << 4) | (tinstr & 0xf);
 	      break;
 	    }
-	  /* Drop through.  */
+	  ATTRIBUTE_FALLTHROUGH;
 	default:
 	  /* Everything else is an undefined instruction.  */
 	  handle_v6_thumb_insn (state, tinstr, next_instr, pc, ainstr, & valid);
@@ -2601,6 +2601,7 @@ ARMul_ThumbDecode (ARMul_State * state,
 	}
       /* else we fall through to process the second half of the BL */
       pc += 2;			/* point the pc at the 2nd half */
+      ATTRIBUTE_FALLTHROUGH;
     case 31:			/* BL instruction 2 */
       if (state->is_v6)
 	{
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index 52b4dc7d6e09..8d928a6f79f9 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -251,7 +251,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
 	(sim_callback,
 	 "Unknown machine type '%d'; please update sim_create_inferior.\n",
 	 mach);
-      /* fall through */
+      ATTRIBUTE_FALLTHROUGH;
 
     case 0:
       /* We wouldn't set the machine type with earlier toolchains, so we
@@ -310,7 +310,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
 	  ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop);
 	  break;
 	}
-      /* Otherwise drop through.  */
+      ATTRIBUTE_FALLTHROUGH;
 
     case bfd_mach_arm_5T:
       ARMul_SelectProcessor (state, ARM_v5_Prop);
-- 
2.43.0


  parent reply	other threads:[~2023-12-21  7:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  7:01 [PATCH/committed 01/20] sim: signal: mark signal callback funcs as noreturn since they don't return Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 02/20] sim: add ATTRIBUTE_FALLTHROUGH for local code Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 03/20] sim: common: fix -Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 04/20] sim: aarch64: " Mike Frysinger
2023-12-21  7:01 ` Mike Frysinger [this message]
2023-12-21  7:01 ` [PATCH/committed 06/20] sim: avr: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 07/20] sim: bfin: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 08/20] sim: cris: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 09/20] sim: erc32: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 10/20] sim: frv: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 11/20] sim: m68hc11: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 12/20] sim: mcore: fix Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 13/20] sim: mips: fix -Wimplicit-fallthrough warnings Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 14/20] sim: or1k: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 15/20] sim: ppc: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 16/20] sim: riscv: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 17/20] sim: rl78: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 18/20] sim: rx: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 19/20] sim: sh: " Mike Frysinger
2023-12-21  7:01 ` [PATCH/committed 20/20] sim: warnings: enable -Wimplicit-fallthrough=5 Mike Frysinger

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=20231221070127.19142-5-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).