diff options
| author | Chong Yidong | 2012-08-14 17:59:25 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-08-14 17:59:25 +0800 |
| commit | dd3c46bd95fc245e54c9ed036f844b0430407732 (patch) | |
| tree | dfde8ffa922d6195d45270f14081fec438a647fa /lib | |
| parent | 7f654971e061afdaa4df62486cde4452abe698de (diff) | |
| download | emacs-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
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gnulib.mk | 1 | ||||
| -rw-r--r-- | lib/stdio.in.h | 21 |
2 files changed, 5 insertions, 17 deletions
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 |