aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check/crc64_table.c
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-09-27 00:02:11 +0800
committerJia Tan <jiat0218@gmail.com>2023-10-31 18:44:59 +0800
commit1bce6fe48334b5df33d0487a9cbe41950122230e (patch)
tree18f1d73b0c73b846d239fad0668fa3179dfaab5d /src/liblzma/check/crc64_table.c
parentBuild: Update the comment about -Werror usage in checks. (diff)
downloadxz-1bce6fe48334b5df33d0487a9cbe41950122230e.tar.xz
liblzma: Avoid compiler warning without creating extra symbol.
When the generic fast crc64 method is used, then we omit lzma_crc64_table[][]. The C standards don't allow an empty translation unit which can be avoided by declaring something, without exporting any symbols.
Diffstat (limited to 'src/liblzma/check/crc64_table.c')
-rw-r--r--src/liblzma/check/crc64_table.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/liblzma/check/crc64_table.c b/src/liblzma/check/crc64_table.c
index 241adcd4..688e527b 100644
--- a/src/liblzma/check/crc64_table.c
+++ b/src/liblzma/check/crc64_table.c
@@ -18,10 +18,8 @@
#if (defined(__x86_64__) && defined(__SSSE3__) \
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|| (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;
+// No table needed. Use a typedef to avoid an empty translation unit.
+typedef void lzma_crc64_dummy;
#else
// Having the declaration here silences clang -Wmissing-variable-declarations.