Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 6 Sep 2022 23:51:35 -0400
From: Jeffrey Walton <noloader@...il.com>
To: musl@...ts.openwall.com
Subject: Re: ecvt(0, 0, ...) is broken

On Tue, Sep 6, 2022 at 11:39 PM Markus Wichmann <nullplan@....net> wrote:
>
> On Tue, Sep 06, 2022 at 03:19:51PM -0400, Rich Felker wrote:
> > On Tue, Sep 06, 2022 at 08:48:26PM +0200, Markus Wichmann wrote:
> > > On Tue, Sep 06, 2022 at 10:17:36AM -0400, Rich Felker wrote:
> > > > But these are garbage functions. The
> > > > right answer is to fix whatever is using them to use snprintf and move
> > > > on.
> > >
> > > Well, then why not remove them from the lib? Any program using them
> > > would invoke a link failure. Indeed, for GCC, the declarations could be
> > > retained and an error attribute be added. Configure tests would fail to
> > > find these functions and possibly switch on alternative paths.
> > >
> > > Of course, that is not ABI compatible. But isn't excising broken
> > > functions better than retaining them?
> >
> > If that were the case we would have removed gets, so no.
> >
>
> That would have been the next function on my hit list.
>
> Alright, next idea then: Could we put a linker warning on these
> functions to encourage users to switch? That would not break ABI, as all
> symbols are still there and the functions do what they are supposed to
> (as well as we ever implemented them, at least). But new compilations
> would get a nag to make them stop.
>
> Unfortunately, it is possible that a configure script may misinterpret
> these warnings as errors, and if it was set up to test for a function's
> existence and the function is mandatory, then that script would fail
> when previously, it would succeed.
>
> What I'm trying to get at more generally here is a mechanism for
> deprecating libc functions. Because apparently we have amassed a few
> junk functions that people should not keep using. And experience
> suggests that merely documenting this state of affairs will not change
> it, since developers only ever read documentation after things go wrong.

Make it a configure option, like --no-xxx or --disablke-xxx. Recommend
the distros build with the option.

Now the problem is transferred to the distros. When a user uses a
deprecated function that's no longer supported by the standard, the
distros can decide what to do. They can help users move away from the
functions, supply patches for the deprecated functions, etc.

Jeff

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.