]> Savannah Git Hosting - gnulib.git/commitdiff
file-has-acl: avoid warning from bleeding-edge GCC
authorJim Meyering <meyering@fb.com>
Sun, 28 May 2023 16:41:08 +0000 (09:41 -0700)
committerJim Meyering <meyering@meta.com>
Sun, 28 May 2023 16:41:08 +0000 (09:41 -0700)
* lib/file-has-acl.c: Include attribute.h.
(have_xattr): Declare with ATTRIBUTE_PURE,
to avoid new warning from GCC14-to-be.
* modules/file-has-acl (Depends-on): Add attribute.
Spotted while building coreutils with this:
gcc version 14.0.0 20230526 (experimental)

ChangeLog
lib/file-has-acl.c
modules/file-has-acl

index e3a2507c47d48603f4788d8ee7837b5c1704582a..93682f526b67ddad3e9c0211f2018a0da21f278f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-05-28  Jim Meyering  <meyering@fb.com>
+
+       file-has-acl: avoid warning from bleeding-edge GCC
+       * lib/file-has-acl.c: Include attribute.h.
+       (have_xattr): Declare with ATTRIBUTE_PURE,
+       to avoid new warning from GCC14-to-be.
+       * modules/file-has-acl (Depends-on): Add attribute.
+       Spotted while building coreutils with this:
+       gcc version 14.0.0 20230526 (experimental)
+
 2023-05-28  Bruno Haible  <bruno@clisp.org>
 
        error: Avoid -Wint-in-bool-context warning.
index 4cddc80bd137a1231e2d8ba50359073ab2a0e776..13f08c305546ee0bd632aca3e05db09cca3065a9 100644 (file)
@@ -28,7 +28,7 @@
 #include "acl.h"
 
 #include "acl-internal.h"
-
+#include "attribute.h"
 #include "minmax.h"
 
 #if USE_ACL && HAVE_LINUX_XATTR_H && HAVE_LISTXATTR
@@ -50,7 +50,7 @@ enum {
 /* Return true if ATTR is in the set represented by the NUL-terminated
    strings in LISTBUF, which is of size LISTSIZE.  */
 
-static bool
+ATTRIBUTE_PURE static bool
 have_xattr (char const *attr, char const *listbuf, ssize_t listsize)
 {
   char const *blim = listbuf + listsize;
index 199fccd6ca7f7971de7cec89f29b974e73874425..ec93313dfdde378f3bdc275755955c16053a6c65 100644 (file)
@@ -8,6 +8,7 @@ m4/acl.m4
 
 Depends-on:
 acl-permissions
+attribute
 extern-inline
 minmax
 free-posix