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

Submitter:  Martin Liška <marxin>
Submitted:  Mon 20 Mar 2017 02:21:38 PM UTC
   
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  Git master
Release:  Reproducibility:  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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-04 arvidjaar StatusNone Fixed
        Open/ClosedOpen Closed
        Planned Release2.03+ 2.02
    2017-03-21 arvidjaar Planned ReleaseNone 2.03+

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code