blob: abe82f3b2decf5a2e8b104b7872c6a77a79743a4 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001eglibc has remove gets starting 2.16
2therefore check for its being there before
3undefining it.
4
5Upstream-Status: Pending
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007---
8diff --git a/lib/stdio.in.h b/lib/stdio.in.h
9index 5727452..f04a691 100644
10--- a/lib/stdio.in.h
11+++ b/lib/stdio.in.h
12@@ -742,10 +742,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013 /* It is very rare that the developer ever has full control of stdin,
14 so any use of gets warrants an unconditional warning; besides, C11
15 removed it. */
16+#if defined gets
17 #undef gets
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 #if HAVE_RAW_DECL_GETS && !defined __cplusplus
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
20 #endif
21+#endif
22
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024 struct obstack;