i386, x86_64, ppc: fix switch fallthrough cases with GCC7

In util/getroot and efidisk slightly modify exitsing comment to mostly
retain it but still make GCC7 compliant with respect to fall through
annotation.

In grub-core/lib/xzembed/xz_dec_lzma2.c it adds same comments as
upstream.

In grub-core/tests/setjmp_tets.c declare functions as "noreturn" to
suppress GCC7 warning.

In grub-core/gnulib/regexec.c use new __attribute__, because existing
annotation is not recognized by GCC7 parser (which requires that comment
immediately precedes case statement).

Otherwise add FALLTHROUGH comment.

Closes: 50598
This commit is contained in:
Andrei Borzenkov 2017-04-04 19:23:55 +03:00
parent 6cef7f6079
commit 4bd4a88725
17 changed files with 32 additions and 3 deletions

View file

@ -750,6 +750,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_START;
/* FALLTHROUGH */
case SEQ_BLOCK_START:
/* We need one byte of input to continue. */
if (b->in_pos == b->in_size)
@ -773,6 +774,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER;
/* FALLTHROUGH */
case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b))
return XZ_OK;
@ -783,6 +785,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS;
/* FALLTHROUGH */
case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b);
if (ret != XZ_STREAM_END)
@ -810,6 +813,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK;
/* FALLTHROUGH */
case SEQ_BLOCK_CHECK:
ret = hash_validate(s, b, 0);
if (ret != XZ_STREAM_END)
@ -858,6 +862,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32;
/* FALLTHROUGH */
case SEQ_INDEX_CRC32:
ret = hash_validate(s, b, 1);
if (ret != XZ_STREAM_END)
@ -866,6 +871,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER;
/* FALLTHROUGH */
case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b))
return XZ_OK;