|
Message-ID: <20241129122208.zsf3nl45fw34eian@devuan>
Date: Fri, 29 Nov 2024 13:22:08 +0100
From: Alejandro Colomar <alx@...nel.org>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: sgetspent(3) on musl
Hi Rich,
On Fri, Nov 29, 2024 at 01:11:44AM -0500, Rich Felker wrote:
> On Wed, Nov 27, 2024 at 01:10:20PM +0100, Alejandro Colomar wrote:
> > Hi Rich,
> >
> > Link: <https://github.com/shadow-maint/shadow/pull/1115#issuecomment-2466994769>
> >
> > There seems to be a prototype for sgetspent(3) on musl libc, but I don't
> > find an definition. The prototype is there since commit 0. Is that a
> > bug? (It looks like a bug, unless I'm missing something.) This results
> > in linker errors. Should the prototype be removed, or the definition be
> > added?
>
> I think having the declaration there is just an oversight. Unless
> we've encountered things that need the missing function, we should
> probably just remove the declaration.
Well, in shadow we have a definition for when running in systems that
lack it. I was going to kill it thinking that all systems had it, but
since you don't, I guess it makes more sense to keep it and that you
just remove your prototype.
I think glibc shouldn't have added it either. This is stuff for a
libshadow, and not for libc, IMO.
>
> FWIW though I don't generally expect spurious declarations like this
> to do any harm
They confuse people like me who assume that if I see a declaration it
means there's a definition. That's what I do with glibc, since finding
their definition of things is not a trivial task. In musl, I should
have checked that there was no definition, since you usually have it
easy to find, but I didn't conceive the possibility of a prototype
without a definition. :)
Since I found "something" and I found it in every libc that I need to
care, I just assumed it exists, without a build-system check. Thanks to
having CI that builds on Alpine, I noticed in time that something was
wrong, but it could have been worse.
> -- detection should be via a compile-and-link test not
> just looking for a declaration. Is there a build system these days
> that's doing purely declaration-based detection?
Probably not; just human brains. :)
Have a lovely day!
Alex
> Rich
--
<https://www.alejandro-colomar.es/>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.