]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: common: fix -Wimplicit-fallthrough warnings
authorMike Frysinger <vapier@gentoo.org>
Thu, 21 Dec 2023 06:29:53 +0000 (01:29 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 21 Dec 2023 06:59:22 +0000 (01:59 -0500)
Replace some fall through comments with the attribute.

sim/common/dv-cfi.c
sim/common/hw-properties.c
sim/common/sim-memopt.c

index 95498d7a2f40dabd2e61f451d68ee11a51e5a3ac..b9c9acdb6820038f1833f70824fdaff27c9f1f09 100644 (file)
@@ -210,7 +210,7 @@ cfi_unshift_addr (struct cfi *cfi, unsigned addr)
 {
   switch (cfi->width)
     {
-    case 4: addr >>= 1; /* fallthrough.  */
+    case 4: addr >>= 1; ATTRIBUTE_FALLTHROUGH;
     case 2: addr >>= 1;
     }
   return addr;
@@ -414,7 +414,7 @@ cfi_io_write_buffer (struct hw *me, const void *source, int space,
          goto done;
        }
 
-      /* Fall through.  */
+      ATTRIBUTE_FALLTHROUGH;
 
     default:
       if (!cfi->cmdset->write (me, cfi, source, offset, value, nr_bytes))
@@ -490,6 +490,8 @@ cfi_io_read_buffer (struct hw *me, void *dest, int space,
          break;
        }
 
+      ATTRIBUTE_FALLTHROUGH;
+
     default:
       if (!cfi->cmdset->read (me, cfi, dest, offset, shifted_offset, nr_bytes))
        HW_TRACE ((me, "unhandled state %s", state_names[cfi->state]));
index f1d7a77ec50d47cab9e3ad12787c18c0ef16df75..42b4d3a7426d706c40f9b5a8d0862c559d4da9d6 100644 (file)
@@ -829,7 +829,7 @@ hw_find_string_array_property (struct hw *me,
       if (node->sizeof_array == 0
          || ((char*)node->array)[node->sizeof_array - 1] != '\0')
        hw_abort (me, "property \"%s\" invalid for string array", property);
-      /* FALL THROUGH */
+      ATTRIBUTE_FALLTHROUGH;
     case string_array_property:
       ASSERT (node->sizeof_array > 0);
       ASSERT (((char*)node->array)[node->sizeof_array - 1] == '\0');
index 7d46a864afc56920f8364f72d7210b61e6af1718..c179d6ab8109f2ee471294ae1b1b0e13d0f1c168 100644 (file)
@@ -300,10 +300,10 @@ parse_size (char *chp,
       break;
     case 'g': case 'G': /* Gigabyte suffix.  */
       *nr_bytes <<= 10;
-      /* Fall through.  */
+      ATTRIBUTE_FALLTHROUGH;
     case 'm': case 'M': /* Megabyte suffix.  */
       *nr_bytes <<= 10;
-      /* Fall through.  */
+      ATTRIBUTE_FALLTHROUGH;
     case 'k': case 'K': /* Kilobyte suffix.  */
       *nr_bytes <<= 10;
       /* Check for a modulo specifier after the suffix.  */