[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] acl: Address pure attribute errors with gcc 4.9
From: |
Ben Walton |
Subject: |
Re: [PATCH] acl: Address pure attribute errors with gcc 4.9 |
Date: |
Sun, 1 Jun 2014 21:31:15 +0100 |
On 1 Jun 2014 21:16, "Pádraig Brady" <address@hidden> wrote:
>
> On 06/01/2014 09:42 AM, Ben Walton wrote:
> > * lib/acl-internal.h (acl_ace_nontrivial): Apply pure attribute
> > * lib/file-has-acl.c: Disable pure attribute error.
> > - The AIX version of acl_nontrivial isn't pure while other
> > versions are. We cannot apply the attribute globally.
> >
> > Signed-off-by: Ben Walton <address@hidden>
> > ---
> > When building coreutils 8.22 on Solaris 10 x86, gcc 4.9.0 emits:
> >
> > ..snip..
> > b/file-has-acl.c: In function 'acl_nontrivial':
> > lib/file-has-acl.c:133:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]
> > acl_nontrivial (int count, aclent_t *entries)
> > ^
> > lib/file-has-acl.c: In function 'acl_ace_nontrivial':
> > lib/file-has-acl.c:164:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]
> > acl_ace_nontrivial (int count, ace_t *entries)
> > ^
> > ..snip..
> >
> > It seems that acl_ace_nontrivial is pure, so mark it as such.
> > For acl_nontrivial though, the AIX version isn't pure, so disable
> > the warning instead. I'm not keen on squashing the warning for all
> > versions of the function, but applying the attribute selectively
> > doesn't feel right either. Maybe I'm missing the nicest solution
> > entirely?
>
> On AIX acl_last() is just a macro that reads mem
> and so gcc should see it as such, so therefore we might
> be able to mark acl_nontrivial() as pure also?
If that's the case, then I fully support marking it explicitly to. Masking the error for any future changes with the pragma seems like the option to choose only when there isn't a better one. I'll resubmit.
Thanks
-Ben