]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix unused-function warning. (#2114)
authorAdrian Iain Lam <adrianiainlam@users.noreply.github.com>
Sat, 13 Apr 2024 05:13:42 +0000 (06:13 +0100)
committerGitHub <noreply@github.com>
Sat, 13 Apr 2024 05:13:42 +0000 (22:13 -0700)
`string_to_size` is only used in a code block conditionally compiled
with `#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream`. If this block is not
compiled, GCC raises a warning with -Wunused-function.

libarchive/archive_write_add_filter_zstd.c

index 94249accd08b61d8fe2ec4331320a91a02a70272..df539d326e2a51a8db8afd6bbc03ea0aee2da191 100644 (file)
@@ -190,6 +190,7 @@ string_to_number(const char *string, intmax_t *numberp)
        return (ARCHIVE_OK);
 }
 
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
 static int
 string_to_size(const char *string, size_t *numberp)
 {
@@ -224,6 +225,7 @@ string_to_size(const char *string, size_t *numberp)
        *numberp = (size_t)(number << shift);
        return (ARCHIVE_OK);
 }
+#endif
 
 /*
  * Set write options.