aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-08-14 17:59:25 +0800
committerChong Yidong2012-08-14 17:59:25 +0800
commitdd3c46bd95fc245e54c9ed036f844b0430407732 (patch)
treedfde8ffa922d6195d45270f14081fec438a647fa
parent7f654971e061afdaa4df62486cde4452abe698de (diff)
downloademacs-dd3c46bd95fc245e54c9ed036f844b0430407732.tar.gz
emacs-dd3c46bd95fc245e54c9ed036f844b0430407732.zip
Fix build failure with glibc-2.16.
* lib/gnulib.mk: * lib/stdio.in.h: * m4/stdio_h.m4: Do not assume that gets is defined. Fixes: debbugs:11873
-rw-r--r--ChangeLog6
-rw-r--r--lib/gnulib.mk1
-rw-r--r--lib/stdio.in.h21
-rw-r--r--m4/stdio_h.m410
4 files changed, 15 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index db8de760ba6..6cc23499bb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12012-08-14 Ulrich Mueller <ulm@gentoo.org>
2
3 * lib/gnulib.mk:
4 * lib/stdio.in.h:
5 * m4/stdio_h.m4: Do not assume that gets is defined (Bug#11873).
6
12012-06-21 Ulrich Mueller <ulm@gentoo.org> 72012-06-21 Ulrich Mueller <ulm@gentoo.org>
2 8
3 * configure.in: Use m/intel386.h for amd64 with x32 ABI. (Bug#11669) 9 * configure.in: Use m/intel386.h for amd64 with x32 ABI. (Bug#11669)
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 154ae9882da..781027d6e7a 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -599,7 +599,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
599 -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ 599 -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
600 -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ 600 -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
601 -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ 601 -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
602 -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \
603 -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ 602 -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
604 -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ 603 -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
605 -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ 604 -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index ce00af574a8..1920830cc14 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -699,22 +699,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
699# endif 699# endif
700#endif 700#endif
701 701
702#if @GNULIB_GETS@
703# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
704# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
705# undef gets
706# define gets rpl_gets
707# endif
708_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
709_GL_CXXALIAS_RPL (gets, char *, (char *s));
710# else
711_GL_CXXALIAS_SYS (gets, char *, (char *s));
712# undef gets
713# endif
714_GL_CXXALIASWARN (gets);
715/* It is very rare that the developer ever has full control of stdin, 702/* It is very rare that the developer ever has full control of stdin,
716 so any use of gets warrants an unconditional warning. Assume it is 703 so any use of gets warrants an unconditional warning. Besides, C11
717 always declared, since it is required by C89. */ 704 removed it. */
705#undef gets
706#if HAVE_RAW_DECL_GETS
718_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); 707_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
719#endif 708#endif
720 709
@@ -1054,7 +1043,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1054# endif 1043# endif
1055#endif 1044#endif
1056 1045
1057/* Some people would argue that sprintf should be handled like gets 1046/* Some people would argue that sprintf uses should be warned about
1058 (for example, OpenBSD issues a link warning for both functions), 1047 (for example, OpenBSD issues a link warning for both functions),
1059 since both can cause security holes due to buffer overruns. 1048 since both can cause security holes due to buffer overruns.
1060 However, we believe that sprintf can be used safely, and is more 1049 However, we believe that sprintf can be used safely, and is more
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 39bf80e2ac9..b362458d1cf 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
1# stdio_h.m4 serial 40 1# stdio_h.m4 serial 41
2dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,6 @@ AC_DEFUN([gl_STDIO_H],
18 GNULIB_GETC=1 18 GNULIB_GETC=1
19 GNULIB_GETCHAR=1 19 GNULIB_GETCHAR=1
20 GNULIB_FGETS=1 20 GNULIB_FGETS=1
21 GNULIB_GETS=1
22 GNULIB_FREAD=1 21 GNULIB_FREAD=1
23 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" 22 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
24 dnl "expected source file, required through AC_LIBSOURCES, not found". It is 23 dnl "expected source file, required through AC_LIBSOURCES, not found". It is
@@ -72,10 +71,10 @@ AC_DEFUN([gl_STDIO_H],
72 71
73 dnl Check for declarations of anything we want to poison if the 72 dnl Check for declarations of anything we want to poison if the
74 dnl corresponding gnulib module is not in use, and which is not 73 dnl corresponding gnulib module is not in use, and which is not
75 dnl guaranteed by C89. 74 dnl guaranteed by C89 and C11.
76 gl_WARN_ON_USE_PREPARE([[#include <stdio.h> 75 gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
77 ]], [dprintf fpurge fseeko ftello getdelim getline pclose popen renameat 76 ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
78 snprintf tmpfile vdprintf vsnprintf]) 77 renameat snprintf tmpfile vdprintf vsnprintf])
79]) 78])
80 79
81AC_DEFUN([gl_STDIO_MODULE_INDICATOR], 80AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -113,7 +112,6 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
113 GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) 112 GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR])
114 GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) 113 GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
115 GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) 114 GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
116 GNULIB_GETS=0; AC_SUBST([GNULIB_GETS])
117 GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) 115 GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
118 GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) 116 GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
119 GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) 117 GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE])