Skip to content

Commit 5513cf5

Browse files
committed
fix implicit fallthrough gcc warnings
This patch addresses implicit fallthrough warnings on the newer gcc compiler. Proper comment to silence the warning or appropriate comments have been added in the case statements. Signed-off-by: Ani Sinha <[email protected]>
1 parent ad45238 commit 5513cf5

File tree

21 files changed

+40
-1
lines changed

21 files changed

+40
-1
lines changed

grub-core/commands/hdparm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args)
328328
ata = ((struct grub_scsi *) disk->data)->data;
329329
break;
330330
}
331+
// fall through
331332
default:
332333
return grub_error (GRUB_ERR_IO, "not an ATA device");
333334
}

grub-core/disk/cryptodisk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
268268
break;
269269
case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
270270
iv[1] = grub_cpu_to_le32 (sector >> 32);
271+
// fall through
271272
case GRUB_CRYPTODISK_MODE_IV_PLAIN:
272273
iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF);
273274
break;

grub-core/disk/diskfilter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily)
7171
case GRUB_DISKFILTER_RAID6:
7272
if (!easily)
7373
need--;
74+
// fall through
7475
case GRUB_DISKFILTER_RAID4:
7576
case GRUB_DISKFILTER_RAID5:
7677
if (!easily)
@@ -507,6 +508,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector,
507508
if (seg->node_count == 1)
508509
return grub_diskfilter_read_node (&seg->nodes[0],
509510
sector, size, buf);
511+
// fall through
510512
case GRUB_DISKFILTER_MIRROR:
511513
case GRUB_DISKFILTER_RAID10:
512514
{

grub-core/disk/efi/efidisk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ name_devices (struct grub_efidisk_data *devices)
262262
{
263263
case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
264264
is_hard_drive = 1;
265+
#if defined(__GNUC__) && __GNUC__ >= 7
266+
__attribute__ ((fallthrough));
267+
#endif
265268
/* Fall through by intention. */
266269
case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
267270
{

grub-core/efiemu/mm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ grub_efiemu_mmap_fill (void)
410410
default:
411411
grub_dprintf ("efiemu",
412412
"Unknown memory type %d. Assuming unusable\n", type);
413+
// fall through
413414
case GRUB_MEMORY_RESERVED:
414415
return grub_efiemu_add_to_mmap (addr, size,
415416
GRUB_EFI_UNUSABLE_MEMORY);

grub-core/font/font.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
12971297
- grub_font_get_xheight (combining_glyphs[i]->font) - 1;
12981298
if (space <= 0)
12991299
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
1300+
// fall through
13001301

13011302
case GRUB_UNICODE_STACK_ATTACHED_ABOVE:
13021303
do_blit (combining_glyphs[i], targetx,
@@ -1338,6 +1339,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
13381339
+ combining_glyphs[i]->height);
13391340
if (space <= 0)
13401341
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
1342+
// fall through
13411343

13421344
case GRUB_UNICODE_STACK_ATTACHED_BELOW:
13431345
do_blit (combining_glyphs[i], targetx, -(bounds.y - space));

grub-core/fs/udf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ grub_udf_read_symlink (grub_fshelp_node_t node)
970970
case 1:
971971
if (ptr[1])
972972
goto fail;
973+
// fall through
973974
case 2:
974975
/* in 4 bytes. out: 1 byte. */
975976
optr = out;

grub-core/gdb/cstub.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ grub_gdb_trap (int trap_no)
336336
/* sAA..AA: Step one instruction from AA..AA(optional). */
337337
case 's':
338338
stepping = 1;
339+
// fall through
339340

340341
/* cAA..AA: Continue at address AA..AA(optional). */
341342
case 'c':

grub-core/gnulib/regexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4104,8 +4104,8 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
41044104
case OP_UTF8_PERIOD:
41054105
if (ch >= ASCII_CHARS)
41064106
return false;
4107-
/* FALLTHROUGH */
41084107
#endif
4108+
// fall through
41094109
case OP_PERIOD:
41104110
if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
41114111
|| (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL)))

grub-core/lib/legacy_parse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
626626
{
627627
case TYPE_FILE_NO_CONSUME:
628628
hold_arg = 1;
629+
// fall through
629630
case TYPE_PARTITION:
630631
case TYPE_FILE:
631632
args[i] = adjust_file (curarg, curarglen);

0 commit comments

Comments
 (0)