]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
fix build error when compiling with --without-xattrs
authorMatteo Croce <teknoraver@meta.com>
Thu, 13 Nov 2025 01:17:22 +0000 (17:17 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 13 Nov 2025 01:21:42 +0000 (17:21 -0800)
* src/extract.c (set_xattr):
* src/xattrs.c (xattrs_xattrs_add, xattrs_xattrs_get, xattrs_xattrs_set):
Add MAYBE_UNUSED.
Copyright-paperwork-exempt: yes

src/extract.c
src/xattrs.c

index 010966bace172a1aeccccf1c0391244331b08db2..b3760ac91bd15d413a9ed7894949b27742148062 100644 (file)
@@ -965,8 +965,9 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made)
    created (e.g., xattrs not available), and a positive number if FILE_NAME was
    created.  */
 static int
-set_xattr (char const *file_name, struct tar_stat_info const *st,
-           mode_t mode, char typeflag)
+set_xattr (MAYBE_UNUSED char const *file_name,
+          MAYBE_UNUSED struct tar_stat_info const *st,
+          MAYBE_UNUSED mode_t mode, MAYBE_UNUSED char typeflag)
 {
 #ifdef HAVE_XATTRS
   if (xattrs_option && st->xattr_map.xm_size)
index 445dde345dc9b6123192f0384323921bf7fcb516..8c2d5062950208b57f4d1702b0da6d9088b0650d 100644 (file)
@@ -76,7 +76,7 @@ xattr_map_add (struct xattr_map *map,
   map->xm_size++;
 }
 
-static void
+MAYBE_UNUSED static void
 xheader_xattr_add (struct tar_stat_info *st,
                   const char *key, const char *val, idx_t len)
 {
@@ -521,8 +521,9 @@ static bool xattrs_masked_out (const char *kw, bool archiving);
    if no mask is given this includes all the user.*, security.*, system.*,
    etc. available domains */
 void
-xattrs_xattrs_get (int parentfd, char const *file_name,
-                   struct tar_stat_info *st, int fd)
+xattrs_xattrs_get (MAYBE_UNUSED int parentfd,
+                  MAYBE_UNUSED char const *file_name,
+                  MAYBE_UNUSED struct tar_stat_info *st, MAYBE_UNUSED int fd)
 {
   if (xattrs_option)
     {
@@ -722,8 +723,9 @@ xattrs_masked_out (const char *kw, bool archiving)
 }
 
 void
-xattrs_xattrs_set (struct tar_stat_info const *st,
-                   char const *file_name, char typeflag, bool later_run)
+xattrs_xattrs_set (MAYBE_UNUSED struct tar_stat_info const *st,
+                  MAYBE_UNUSED char const *file_name,
+                  MAYBE_UNUSED char typeflag, MAYBE_UNUSED bool later_run)
 {
   if (xattrs_option)
     {