[Skiboot] [PATCH 1/2] xz: add fallthrough annotations to silence GCC7 warning

Stewart Smith stewart at linux.vnet.ibm.com
Wed Jul 12 15:18:34 AEST 2017


The fallthrough is intentional (or at least appears to be), and
I'd rather not have warnings show up in the skiboot build at all.

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 libxz/xz_dec_lzma2.c  |  4 ++--
 libxz/xz_dec_stream.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libxz/xz_dec_lzma2.c b/libxz/xz_dec_lzma2.c
index 7ba6cdbf874e..2caa763819eb 100644
--- a/libxz/xz_dec_lzma2.c
+++ b/libxz/xz_dec_lzma2.c
@@ -1042,7 +1042,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
                 return XZ_DATA_ERROR;
 
             s->lzma2.sequence = SEQ_LZMA_PREPARE;
-
+	    /* fallthrough */
         case SEQ_LZMA_PREPARE:
             if (s->lzma2.compressed < RC_INIT_BYTES)
                 return XZ_DATA_ERROR;
@@ -1052,7 +1052,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
 
             s->lzma2.compressed -= RC_INIT_BYTES;
             s->lzma2.sequence = SEQ_LZMA_RUN;
-
+	    /* fallthrough */
         case SEQ_LZMA_RUN:
             /*
              * Set dictionary limit to indicate how much we want
diff --git a/libxz/xz_dec_stream.c b/libxz/xz_dec_stream.c
index 08d26af18de3..9301f2cf55bb 100644
--- a/libxz/xz_dec_stream.c
+++ b/libxz/xz_dec_stream.c
@@ -603,7 +603,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
             ret = dec_stream_header(s);
             if (ret != XZ_OK)
                 return ret;
-
+	    /* fallthrough */
         case SEQ_BLOCK_START:
             /* We need one byte of input to continue. */
             if (b->in_pos == b->in_size)
@@ -626,7 +626,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
             s->temp.size = s->block_header.size;
             s->temp.pos = 0;
             s->sequence = SEQ_BLOCK_HEADER;
-
+	    /* fallthrough */
         case SEQ_BLOCK_HEADER:
             if (!fill_temp(s, b))
                 return XZ_OK;
@@ -636,7 +636,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
                 return ret;
 
             s->sequence = SEQ_BLOCK_UNCOMPRESS;
-
+	    /* fallthrough */
         case SEQ_BLOCK_UNCOMPRESS:
             ret = dec_block(s, b);
             if (ret != XZ_STREAM_END)
@@ -663,7 +663,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:
             if (s->check_type == XZ_CHECK_CRC32) {
                 ret = crc_validate(s, b, 32);
@@ -712,7 +712,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
                 return XZ_DATA_ERROR;
 
             s->sequence = SEQ_INDEX_CRC32;
-
+	    /* fallthrough */
         case SEQ_INDEX_CRC32:
             ret = crc_validate(s, b, 32);
             if (ret != XZ_STREAM_END)
@@ -720,7 +720,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;
-- 
2.13.0



More information about the Skiboot mailing list