[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] file-has-acl: avoid warning from bleeding-edge GCC
From: |
Jim Meyering |
Subject: |
Re: [PATCH] file-has-acl: avoid warning from bleeding-edge GCC |
Date: |
Sun, 28 May 2023 11:12:47 -0700 |
On Sun, May 28, 2023 at 10:08 AM Bruno Haible <bruno@clisp.org> wrote:
>
> 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
Hi Bruno,
I did see those, but in the meantime, it's a tiny change that lets us
continue to enable warnings when building on the latest systems. I'll
be happy to revert it the moment GCC's behavior changes.