svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio

Conrad Meyer cem at freebsd.org
Sun Sep 1 21:21:11 UTC 2019


On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert <Cy.Schubert at cschubert.com> wrote:
> In message <201909011612.x81GC5DW097846 at repo.freebsd.org>, Ed Maste writes:
> > Author: emaste
> > Date: Sun Sep  1 16:12:05 2019
> > New Revision: 351659
> > URL: https://svnweb.freebsd.org/changeset/base/351659
> >
> > Log:
> >   libc: remove gets
> > ...
>
> Should we encourage the use of gets_s() in the man page or in other doc?

Hi Cy,

Short version: no, we shouldn't. :-)

Longer version:  Annex K functions like gets_s have zero real adoption
(Microsoft's APIs that inspired Annex K are not actually compatible
with the version in the standards); broadly terrible APIs; and in this
particular case and others, unnecessarily duplicate the functionality
of existing long-standing standard C functions (e.g., fgets(3)).

Also, it's been a *long* time since gets(3) was known to be extremely
broken and rejected by -D_FORTIFY_SOURCE and friends; at least twenty
years just going by the C99 standard.  I don't think developers need
an advisory about using alternatives to gets(3) at this point in time.

Best,
Conrad


More information about the svn-src-all mailing list