]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add __LA_UNUSED because clang warns for static inline functions that are
authorChristos Zoulas <christos@zoulas.com>
Mon, 29 Mar 2021 21:55:43 +0000 (17:55 -0400)
committerChristos Zoulas <christos@zoulas.com>
Mon, 29 Mar 2021 21:55:43 +0000 (17:55 -0400)
not used.

libarchive/archive_private.h
libarchive/archive_read_disk_posix.c

index 937a87bb1efcac80cb349aba73f7e23fbc765a13..55a8da18eab6623a230a63a3a9e1efe20bffaf89 100644 (file)
 #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)
index 3c8bd11e839353ad066fe58347e848242a92c115..f93c65255d1de7e9b64495161f5d8b1af942c500 100644 (file)
@@ -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;