Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Sep 2019 14:20:58 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>,  svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio
Message-ID:  <CAG6CVpVMN6BkATaz7qqhaVHhUpqQLrP3kSWHpMzPz2AR5GnaQw@mail.gmail.com>
In-Reply-To: <201909011932.x81JWYts004074@slippy.cwsent.com>
References:  <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert <Cy.Schubert@cschubert.com> wrote:
> In message <201909011612.x81GC5DW097846@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpVMN6BkATaz7qqhaVHhUpqQLrP3kSWHpMzPz2AR5GnaQw>