]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Fix or hide warnings from GCC 7's -Wimplicit-fallthrough.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 14 Aug 2017 17:08:33 +0000 (20:08 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 14 Aug 2017 17:08:33 +0000 (20:08 +0300)
src/liblzma/lzma/lzma_decoder.c
src/xz/list.c

index eedc0733f9b3f8677de8078ed7fe41da98c7d072..d0f29b763a3c384a6760d7f8a5d1133e8d3fd8fe 100644 (file)
 #include "lzma_decoder.h"
 #include "range_decoder.h"
 
+// The macros unroll loops with switch statements.
+// Silence warnings about missing fall-through comments.
+#if TUKLIB_GNUC_REQ(7, 0)
+#      pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
 
 #ifdef HAVE_SMALL
 
index bf462957148a12be27cdbc9022da7d259b4d4f74..ef93314ce05593aa5a842a8df3e49746e4d2ba23 100644 (file)
@@ -318,6 +318,8 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
                // If the above fails, the file is corrupt so
                // LZMA_DATA_ERROR is a good error code.
 
+       // Fall through
+
        case LZMA_DATA_ERROR:
                // Free the memory allocated by lzma_block_header_decode().
                for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)