Re: git: 3f5788e0ed8e - main - lib/libc/string/ffs*.c: work around gcc warning

From: Brooks Davis <brooks_at_freebsd.org>
Date: Fri, 14 Jul 2023 20:57:18 UTC
On Fri, Jul 14, 2023 at 08:50:49PM +0000, Brooks Davis wrote:
> On Fri, Jul 14, 2023 at 08:27:35PM +0000, Robert Clausecker wrote:
> > The branch main has been updated by fuz:
> > 
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3f5788e0ed8e85567f651ad360596b8c330af5a9
> > 
> > commit 3f5788e0ed8e85567f651ad360596b8c330af5a9
> > Author:     Robert Clausecker <fuz@FreeBSD.org>
> > AuthorDate: 2023-07-10 22:10:52 +0000
> > Commit:     Robert Clausecker <fuz@FreeBSD.org>
> > CommitDate: 2023-07-14 20:26:43 +0000
> > 
> >     lib/libc/string/ffs*.c: work around gcc warning
> >     
> >     Gcc warns of infinite recursion if we use __builtin_ffs*() to
> >     implement ffs*().  This is because gcc uses ffs() to implement
> >     these on some platforms.  Sidestep the warning by using
> >     __builtin_ctz*() for these.
> 
> Thank you for fixing this.
> 
> The warning seems to be rather bogus and we might be better off
> suppressing it as (based on poking at compiler explorer) the warning
> doesn't appear to apply to any architecture we care about and quite a few
> compilers generate worse code for the __builtin_ctz*() implementations
> (including gcc for x86-64 at -O2):
> 
> https://godbolt.org/z/E174v96GT

Oops, I missed a case.  riscv64 gcc does call ffs so never mind.

-- Brooks