From b5182fa98c4aaf973fbe93597f2ca1025dfda5fe Mon Sep 17 00:00:00 2001 From: Adrian Iain Lam Date: Sat, 13 Apr 2024 06:13:42 +0100 Subject: [PATCH] Fix unused-function warning. (#2114) `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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libarchive/archive_write_add_filter_zstd.c b/libarchive/archive_write_add_filter_zstd.c index 94249accd..df539d326 100644 --- a/libarchive/archive_write_add_filter_zstd.c +++ b/libarchive/archive_write_add_filter_zstd.c @@ -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. -- 2.47.2