From: Christos Zoulas Date: Mon, 29 Mar 2021 21:55:43 +0000 (-0400) Subject: Add __LA_UNUSED because clang warns for static inline functions that are X-Git-Tag: v3.5.2~19^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89e0143449d14d89302d4842c9da73e50149ae46;p=thirdparty%2Flibarchive.git Add __LA_UNUSED because clang warns for static inline functions that are not used. --- diff --git a/libarchive/archive_private.h b/libarchive/archive_private.h index 937a87bb1..55a8da18e 100644 --- a/libarchive/archive_private.h +++ b/libarchive/archive_private.h @@ -46,6 +46,13 @@ #define __LA_DEAD #endif +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) +#define __LA_UNUSED __attribute__((__unused__)) +#else +#define __LA_UNUSED +#endif + #define ARCHIVE_WRITE_MAGIC (0xb0c5c0deU) #define ARCHIVE_READ_MAGIC (0xdeb0c5U) #define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U) diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index 3c8bd11e8..f93c65255 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -1523,7 +1523,7 @@ get_xfer_size(struct tree *t, int fd, const char *path) #endif #if defined(HAVE_STATVFS) -static inline void +static inline __LA_UNUSED void set_statvfs_transfer_size(struct filesystem *fs, const struct statvfs *sfs) { fs->xfer_align = sfs->f_frsize > 0 ? (long)sfs->f_frsize : -1; @@ -1539,7 +1539,7 @@ set_statvfs_transfer_size(struct filesystem *fs, const struct statvfs *sfs) #endif #if defined(HAVE_STATFS) -static inline void +static inline __LA_UNUSED void set_statfs_transfer_size(struct filesystem *fs, const struct statfs *sfs) { fs->xfer_align = sfs->f_bsize > 0 ? (long)sfs->f_bsize : -1;