[PATCH] D67316: Remove ::gets for FreeBSD 13 and later

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 15:17:43 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371324: Remove ::gets for FreeBSD 13 and later (authored by dim, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D67316?vs=219245&id=219253#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67316/new/

https://reviews.llvm.org/D67316

Files:
  libcxx/trunk/include/__config
  libcxx/trunk/include/cstdio


Index: libcxx/trunk/include/cstdio
===================================================================
--- libcxx/trunk/include/cstdio
+++ libcxx/trunk/include/cstdio
@@ -152,7 +152,7 @@
 
 #ifndef _LIBCPP_HAS_NO_STDIN
 using ::getchar;
-#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
+#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
 using ::gets;
 #endif
 using ::scanf;
Index: libcxx/trunk/include/__config
===================================================================
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -1152,6 +1152,13 @@
 #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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67316.219253.patch
Type: text/x-patch
Size: 1083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190907/c8ef07da/attachment-0001.bin>


More information about the llvm-commits mailing list