diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2017-08-14 20:08:33 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2017-08-14 20:08:33 +0300 |
commit | 94e3f986aa4e14b4ff01ac24857f499630d6d180 (patch) | |
tree | 6d847641c02183745536e68c20704aeda72b5b0c /src | |
parent | Docs: Fix a typo in a comment in doc/examples/02_decompress.c. (diff) | |
download | xz-94e3f986aa4e14b4ff01ac24857f499630d6d180.tar.xz |
Fix or hide warnings from GCC 7's -Wimplicit-fallthrough.
Diffstat (limited to 'src')
-rw-r--r-- | src/liblzma/lzma/lzma_decoder.c | 6 | ||||
-rw-r--r-- | src/xz/list.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c index eedc0733..d0f29b76 100644 --- a/src/liblzma/lzma/lzma_decoder.c +++ b/src/liblzma/lzma/lzma_decoder.c @@ -16,6 +16,12 @@ #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 diff --git a/src/xz/list.c b/src/xz/list.c index bf462957..ef93314c 100644 --- a/src/xz/list.c +++ b/src/xz/list.c @@ -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) |