[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] acl: Address pure attribute errors with gcc 4.9
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] acl: Address pure attribute errors with gcc 4.9 |
Date: |
Sun, 01 Jun 2014 21:16:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
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?
thanks,
Pádraig.