From: Jim Meyering Date: Sun, 28 May 2023 16:41:08 +0000 (-0700) Subject: file-has-acl: avoid warning from bleeding-edge GCC X-Git-Tag: v1.0~1279 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=2bd4c8dc13de3121d76dad755a255c8e92fd46a7;p=gnulib.git 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) --- diff --git a/ChangeLog b/ChangeLog index e3a2507c47..93682f526b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2023-05-28 Jim Meyering + + 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 error: Avoid -Wint-in-bool-context warning. diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index 4cddc80bd1..13f08c3055 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -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; diff --git a/modules/file-has-acl b/modules/file-has-acl index 199fccd6ca..ec93313dfd 100644 --- a/modules/file-has-acl +++ b/modules/file-has-acl @@ -8,6 +8,7 @@ m4/acl.m4 Depends-on: acl-permissions +attribute extern-inline minmax free-posix