Hi Jim,

Jim Meyering wrote:
> FYI, just pushed, to avoid this:
> 
>   lib/file-has-acl.c: In function 'have_xattr':
>   lib/file-has-acl.c:54:1: error: function might be candidate for attribute 
> 'pure' if it is known to return normally [-Werror=suggest-attribute=pure]
>      54 | have_xattr (char const *attr, char const *listbuf, ssize_t listsize)
> 

Just a week ago, Paul wrote [1]:
  "it's not helpful for GCC to issue -Wsuggest-attribute diagnostics for static
   functions. If GCC has already figured out that the function is pure or const
   or whatever then that's good enough: GCC shouldn't badger the programmer to
   complicate the program to record something that GCC can easily calculate for
   itself.

   This sounds like GCC bug 85734, which has been marked as fixed. Evidently
   it's rearing its ugly head again. We should fix the bug rather than pollute
   the code with compiler pacifications."

and then I reported this precise warning as a GCC bug. [2]

Bruno

[1] https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00139.html
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914




Reply via email to