Subject: bug#20753: closed (Re: coreutils failed to compile)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 07 Jun 2015 01:24:02 +0000

Your bug report

#20753: coreutils failed to compile

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
20753: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20753
GNU Bug Tracking System
Contact [email-masked] with problems

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

Subject: coreutils failed to compile
From: Masanari Iida <[email-masked]>
To: [email-masked], [email-masked]
Date: Sat, 6 Jun 2015 22:45:51 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Current head of coreutil git tree ( 079652ee6b5d3) faile to compile.
My environment

Fedora 20 (x86_64)

  GEN      src/version.h
make  all-recursive
make[1]: Entering directory `/home/iida/Repo/coreutils'
Making all in po
make[2]: Entering directory `/home/iida/Repo/coreutils/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/iida/Repo/coreutils/po'
Making all in .
make[2]: Entering directory `/home/iida/Repo/coreutils'
test -f doc/.dirstamp || make  doc/.dirstamp
Updating ./doc/version.texi
  CC       lib/copy-acl.o
  CC       lib/set-acl.o
  CC       lib/acl-errno-valid.o
  CC       lib/acl-internal.o
lib/acl-internal.c: In function 'free_permission_context':
lib/acl-internal.c:472:1: error: function might be candidate for
attribute 'const' [-Werror=suggest-attribute=const]
 free_permission_context (struct permission_context *ctx)
 ^

Bisect shows following commit is the first bad.

[iida@localhsot coreutils ((d796a29...)|BISECTING)]$ git bisect good
44f08f240e69e062fd8f0ac33f2a2e0e07a2a3cd is the first bad commit
commit 44f08f240e69e062fd8f0ac33f2a2e0e07a2a3cd
Author: Pádraig Brady <[email-masked]>
Date:   Tue Jun 2 01:25:05 2015 +0100

    build: update to latest gnulib

    Mainly with build fixes for Mac OS X.

:160000 160000 2aea2c723359d9459fd01e7b428f47656c9ce1e9
98aa8776dd2b510b7f777870fb76b17fd88abbef M    gnulib

[iida@localhost coreutils ((d796a29...)|BISECTING)]$ git bisect log
git bisect start
# bad: [079652ee6b5d3987525ce225518a15253fc9d319] build: port to AIX
git bisect bad 079652ee6b5d3987525ce225518a15253fc9d319
# good: [1aa71d96332ec210a8c954cc924d43655f2b369f] tests:
ln/hard-to-sym FAIL rather than ERROR when ln fails
git bisect good 1aa71d96332ec210a8c954cc924d43655f2b369f
# bad: [44f08f240e69e062fd8f0ac33f2a2e0e07a2a3cd] build: update to latest gnulib
git bisect bad 44f08f240e69e062fd8f0ac33f2a2e0e07a2a3cd
# good: [b9842a615366b47cbd0739d97f2dd2679dfbb3a8] maint: avoid new
coverity warnings
git bisect good b9842a615366b47cbd0739d97f2dd2679dfbb3a8
# good: [d796a29f2fb92f74d73d0aa27c86caf58d753f46] tests: fix race in
tail test without inotify
git bisect good d796a29f2fb92f74d73d0aa27c86caf58d753f46
# first bad commit: [44f08f240e69e062fd8f0ac33f2a2e0e07a2a3cd] build:
update to latest gnulib

Regards,
Masanari iida