From owner-svn-src-projects@freebsd.org Thu Sep 19 19:39:34 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC0F512C989 for ; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6cQ5WGvz4BfH; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A13621A3B4; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JJdYTC090664; Thu, 19 Sep 2019 19:39:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JJdYMT090662; Thu, 19 Sep 2019 19:39:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191939.x8JJdYMT090662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 19:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352538 - projects/clang900-import/contrib/libc++/include X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang900-import/contrib/libc++/include X-SVN-Commit-Revision: 352538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:39:34 -0000 Author: dim Date: Thu Sep 19 19:39:34 2019 New Revision: 352538 URL: https://svnweb.freebsd.org/changeset/base/352538 Log: Partially undo r351659, which unconditionally removed gets(3) from libc++. Instead, pull in r371324 from upstream libc++ trunk (by me): Remove ::gets for FreeBSD 13 and later Summary: In https://svnweb.freebsd.org/changeset/base/351659 @emaste removed gets() from FreeBSD 13's libc, and our copies of libc++ and libstdc++. In that change, the declarations were simply deleted, but I would like to propose this conditional test instead. Reviewers: EricWF, mclow.lists, emaste Reviewed By: mclow.lists Subscribers: krytarowski, christof, ldionne, emaste, libcxx-commits Differential Revision: https://reviews.llvm.org/D67316 This makes these changes more MFCable. Modified: projects/clang900-import/contrib/libc++/include/__config projects/clang900-import/contrib/libc++/include/cstdio Modified: projects/clang900-import/contrib/libc++/include/__config ============================================================================== --- projects/clang900-import/contrib/libc++/include/__config Thu Sep 19 19:26:12 2019 (r352537) +++ projects/clang900-import/contrib/libc++/include/__config Thu Sep 19 19:39:34 2019 (r352538) @@ -1129,6 +1129,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_ #define _LIBCPP_HAS_NO_STDOUT #endif +// Some systems do not provide gets() in their C library, for security reasons. +#ifndef _LIBCPP_C_HAS_NO_GETS +# if defined(_LIBCPP_MSVCRT) || (defined(__FreeBSD__) && __FreeBSD__ >= 13) +# define _LIBCPP_C_HAS_NO_GETS +# endif +#endif + #if defined(__BIONIC__) || defined(__CloudABI__) || \ defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE Modified: projects/clang900-import/contrib/libc++/include/cstdio ============================================================================== --- projects/clang900-import/contrib/libc++/include/cstdio Thu Sep 19 19:26:12 2019 (r352537) +++ projects/clang900-import/contrib/libc++/include/cstdio Thu Sep 19 19:39:34 2019 (r352538) @@ -73,6 +73,7 @@ int fputc(int c, FILE* stream); int fputs(const char* restrict s, FILE* restrict stream); int getc(FILE* stream); int getchar(void); +char* gets(char* s); // removed in C++14 int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); @@ -151,6 +152,9 @@ using ::tmpnam; #ifndef _LIBCPP_HAS_NO_STDIN using ::getchar; +#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) +using ::gets; +#endif using ::scanf; using ::vscanf; #endif