Skip to content

Commit b5182fa

Browse files
Fix unused-function warning. (libarchive#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.
1 parent b904d6c commit b5182fa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libarchive/archive_write_add_filter_zstd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ string_to_number(const char *string, intmax_t *numberp)
190190
return (ARCHIVE_OK);
191191
}
192192

193+
#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
193194
static int
194195
string_to_size(const char *string, size_t *numberp)
195196
{
@@ -224,6 +225,7 @@ string_to_size(const char *string, size_t *numberp)
224225
*numberp = (size_t)(number << shift);
225226
return (ARCHIVE_OK);
226227
}
228+
#endif
227229

228230
/*
229231
* Set write options.

0 commit comments

Comments
 (0)