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 <bdwal...@gmail.com> > --- > 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.