Karel Klic bfdd6c
diff -up emacs-24.1/lib/stdio.in.h.nogets emacs-24.1/lib/stdio.in.h
Karel Klic bfdd6c
--- emacs-24.1/lib/stdio.in.h.nogets	2012-04-08 05:03:02.000000000 +0200
Karel Klic bfdd6c
+++ emacs-24.1/lib/stdio.in.h	2012-07-11 18:25:11.120972062 +0200
Karel Klic bfdd6c
@@ -699,22 +699,11 @@ _GL_WARN_ON_USE (getline, "getline is un
Karel Klic bfdd6c
 # endif
Karel Klic bfdd6c
 #endif
Karel Klic bfdd6c
 
Karel Klic bfdd6c
-#if @GNULIB_GETS@
Karel Klic bfdd6c
-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Karel Klic bfdd6c
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Karel Klic bfdd6c
-#   undef gets
Karel Klic bfdd6c
-#   define gets rpl_gets
Karel Klic bfdd6c
-#  endif
Karel Klic bfdd6c
-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
Karel Klic bfdd6c
-_GL_CXXALIAS_RPL (gets, char *, (char *s));
Karel Klic bfdd6c
-# else
Karel Klic bfdd6c
-_GL_CXXALIAS_SYS (gets, char *, (char *s));
Karel Klic bfdd6c
-#  undef gets
Karel Klic bfdd6c
-# endif
Karel Klic bfdd6c
-_GL_CXXALIASWARN (gets);
Karel Klic bfdd6c
 /* It is very rare that the developer ever has full control of stdin,
Karel Klic bfdd6c
-   so any use of gets warrants an unconditional warning.  Assume it is
Karel Klic bfdd6c
-   always declared, since it is required by C89.  */
Karel Klic bfdd6c
+   so any use of gets warrants an unconditional warning; besides, C11
Karel Klic bfdd6c
+   removed it.  */
Karel Klic bfdd6c
+#undef gets
Karel Klic bfdd6c
+#if HAVE_RAW_DECL_GETS
Karel Klic bfdd6c
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
Karel Klic bfdd6c
 #endif
Karel Klic bfdd6c
 
Karel Klic bfdd6c
diff -up emacs-24.1/m4/stdio_h.m4.nogets emacs-24.1/m4/stdio_h.m4
Karel Klic bfdd6c
--- emacs-24.1/m4/stdio_h.m4.nogets	2012-04-08 05:03:02.000000000 +0200
Karel Klic bfdd6c
+++ emacs-24.1/m4/stdio_h.m4	2012-07-11 18:25:48.112449063 +0200
Karel Klic bfdd6c
@@ -18,7 +18,6 @@ AC_DEFUN([gl_STDIO_H],
Karel Klic bfdd6c
   GNULIB_GETC=1
Karel Klic bfdd6c
   GNULIB_GETCHAR=1
Karel Klic bfdd6c
   GNULIB_FGETS=1
Karel Klic bfdd6c
-  GNULIB_GETS=1
Karel Klic bfdd6c
   GNULIB_FREAD=1
Karel Klic bfdd6c
   dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
Karel Klic bfdd6c
   dnl "expected source file, required through AC_LIBSOURCES, not found". It is
Karel Klic bfdd6c
@@ -113,7 +112,6 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
Karel Klic bfdd6c
   GNULIB_GETCHAR=0;              AC_SUBST([GNULIB_GETCHAR])
Karel Klic bfdd6c
   GNULIB_GETDELIM=0;             AC_SUBST([GNULIB_GETDELIM])
Karel Klic bfdd6c
   GNULIB_GETLINE=0;              AC_SUBST([GNULIB_GETLINE])
Karel Klic bfdd6c
-  GNULIB_GETS=0;                 AC_SUBST([GNULIB_GETS])
Karel Klic bfdd6c
   GNULIB_OBSTACK_PRINTF=0;       AC_SUBST([GNULIB_OBSTACK_PRINTF])
Karel Klic bfdd6c
   GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
Karel Klic bfdd6c
   GNULIB_PCLOSE=0;               AC_SUBST([GNULIB_PCLOSE])