Subject: Re: coreutils failed to compile
From: Paul Eggert <[email-masked]>
To: Masanari Iida <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 06 Jun 2015 18:23:22 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

OK, thanks, I installed the attached patch into gnulib and am marking the bug as 
fixed.
From 64910190567221ed14fc0c7c6739b2802aeac613 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 6 Jun 2015 18:20:40 -0700
Subject: [PATCH] acl-permissions: pacify -Wsuggest-attribute=const

Problem reported by Masanari Iida in: http://bugs.gnu.org/20753
* lib/acl-internal.h (free_permission_context):
Declare with attribute const if ! (defined USE_ACL &&
(HAVE_ACL_GET_FILE || defined GETACL)).
---
 ChangeLog          | 6 ++++++
 lib/acl-internal.h | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a215c03..64b9de1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2015-06-06  Paul Eggert  <[email-masked]>
 
+	acl-permissions: pacify -Wsuggest-attribute=const
+	Problem reported by Masanari Iida in: http://bugs.gnu.org/20753
+	* lib/acl-internal.h (free_permission_context):
+	Declare with attribute const if ! (defined USE_ACL &&
+	(HAVE_ACL_GET_FILE || defined GETACL)).
+
 	fsync: document AIX misbehavior
 	* doc/posix-functions/fsync.texi (fsync):
 	Document failure on AIX with read-only file descriptor.
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 11fdea1..d592a75 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -289,6 +289,10 @@ struct permission_context {
 
 int get_permissions (const char *, int, mode_t, struct permission_context *);
 int set_permissions (struct permission_context *, const char *, int);
-void free_permission_context (struct permission_context *);
+void free_permission_context (struct permission_context *)
+#if ! (defined USE_ACL && (HAVE_ACL_GET_FILE || defined GETACL))
+    _GL_ATTRIBUTE_CONST
+#endif
+  ;
 
 _GL_INLINE_HEADER_END
-- 
2.1.0