bugGNU GRUB - Bugs: bug #50598, GCC7: -Werror=implicit-fallthrough

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #50598: GCC7: -Werror=implicit-fallthrough

Submitted by:  Martin Liška <marxin>
Submitted on:  Mon 20 Mar 2017 02:21:38 PM UTC  
 
Category: NoneSeverity: Major
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Git masterReproducibility: None
Planned Release: 2.02

Tue 04 Apr 2017 04:26:34 PM UTC, comment #2:

Believed to be fixed by 4bd4a88725604471fdbd86316c91967a7f4dba5a; reopen if needed.

Andrei Borzenkov <arvidjaar>
Project Member
Tue 21 Mar 2017 01:13:23 PM UTC, comment #1:

> - /* Fallthrough in case that lvm-tools are unavailable. */
> + /* Fallthrough- in case that lvm-tools are unavailable. */


According to GCC7 documentation, final dash is optional. So it looks more like GCC problem. The following should match exiting comment:

Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!](-[^\n\r])?

Current xzembed upstream seems to add missing comments; will look at updating after 2.02.

Andrei Borzenkov <arvidjaar>
Project Member
Mon 20 Mar 2017 02:21:38 PM UTC, original submission:

Following issues are seen by GCC7:

1)

util/getroot.c: In function ‘grub_util_pull_device’:
util/getroot.c:101:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
grub_util_pull_lvm_by_command (os_dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util/getroot.c:103:5: note: here
case GRUB_DEV_ABSTRACTION_LUKS:
^~~~

Can be fixed by:
diff --git a/util/getroot.c b/util/getroot.c
index 92c0d709b..41bed6131 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -99,7 +99,7 @@ grub_util_pull_device (const char *os_dev)
{
case GRUB_DEV_ABSTRACTION_LVM:
grub_util_pull_lvm_by_command (os_dev);
- /* Fallthrough in case that lvm-tools are unavailable. */
+ /* Fallthrough- in case that lvm-tools are unavailable. */
case GRUB_DEV_ABSTRACTION_LUKS:
grub_util_pull_devmapper (os_dev);
return;

2)
grub-core/lib/xzembed/xz_dec_lzma2.c: In function ‘xz_dec_lzma2_run’:
grub-core/lib/xzembed/xz_dec_lzma2.c:1045:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->lzma2.sequence = SEQ_LZMA_PREPARE;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_lzma2.c:1047:3: note: here
case SEQ_LZMA_PREPARE:
^~~~
grub-core/lib/xzembed/xz_dec_lzma2.c:1055:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->lzma2.sequence = SEQ_LZMA_RUN;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_lzma2.c:1057:3: note: here
case SEQ_LZMA_RUN:
^~~~

3) grub-core/lib/xzembed/xz_dec_stream.c: In function ‘dec_main’:
grub-core/lib/xzembed/xz_dec_stream.c:751:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_BLOCK_START;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:753:3: note: here
case SEQ_BLOCK_START:
^~~~
grub-core/lib/xzembed/xz_dec_stream.c:774:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_BLOCK_HEADER;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:776:3: note: here
case SEQ_BLOCK_HEADER:
^~~~
grub-core/lib/xzembed/xz_dec_stream.c:784:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_BLOCK_UNCOMPRESS;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:786:3: note: here
case SEQ_BLOCK_UNCOMPRESS:
^~~~
grub-core/lib/xzembed/xz_dec_stream.c:811:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_BLOCK_CHECK;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:813:3: note: here
case SEQ_BLOCK_CHECK:
^~~~
grub-core/lib/xzembed/xz_dec_stream.c:859:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_INDEX_CRC32;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:861:3: note: here
case SEQ_INDEX_CRC32:
^~~~
grub-core/lib/xzembed/xz_dec_stream.c:867:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
s->sequence = SEQ_STREAM_FOOTER;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
grub-core/lib/xzembed/xz_dec_stream.c:869:3: note: here
case SEQ_STREAM_FOOTER:
^~~~

4) util/grub-mkimagexx.c:899:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
{
^
util/grub-mkimagexx.c:910:3: note: here
case R_IA64_LTOFF_FPTR22:
^~~~

And maybe other locations.

Thanks

Martin Liška <marxin>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arvidjaar (Posted a comment)
  • -unavailable- added by marxin (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 04 Apr 2017 04:26:34 PM UTCarvidjaarStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Planned Release2.03+=>2.02
    Tue 21 Mar 2017 01:13:23 PM UTCarvidjaarPlanned ReleaseNone=>2.03+

    Back to the top


    Powered by Savane 3.1-cleanup1