]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Avoid compiler warning without creating extra symbol.
authorJia Tan <jiat0218@gmail.com>
Tue, 26 Sep 2023 16:02:11 +0000 (00:02 +0800)
committerJia Tan <jiat0218@gmail.com>
Tue, 26 Sep 2023 16:04:40 +0000 (00:04 +0800)
When the generic fast crc64 method is used, then we omit
lzma_crc64_table[][]. Similar to
d9166b52cf3458a4da3eb92224837ca8fc208d79, we can avoid compiler warnings
with -Wempty-translation-unit (Clang) or -pedantic (GCC) by creating a
never used typedef instead of an extra symbol.

src/liblzma/check/crc64_table.c

index 241adcd4a5cbeba2251fd078fc8a3914f8baf411..6f9adb04d57d3df3ea3d893a01d6096923433d68 100644 (file)
@@ -20,8 +20,7 @@
                || (defined(__e2k__) && __iset__ >= 6)
 // No table needed but something has to be exported to keep some toolchains
 // happy. Also use a declaration to silence compiler warnings.
-extern const char lzma_crc64_dummy;
-const char lzma_crc64_dummy;
+typedef void lzma_crc64_dummy;
 
 #else
 // Having the declaration here silences clang -Wmissing-variable-declarations.