]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Backport gnulib fixes for C11. Fixes Savannah bug #37738.
authorColin Watson <cjwatson@ubuntu.com>
Fri, 28 Dec 2012 06:43:35 +0000 (06:43 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Fri, 28 Dec 2012 06:43:35 +0000 (06:43 +0000)
* grub-core/gnulib/stdio.in.h (gets): Warn on use only if
HAVE_RAW_DECL_GETS.
* m4/stdio_h.m4 (gl_STDIO_H): Check for gets.

ChangeLog
grub-core/gnulib/stdio.in.h
m4/stdio_h.m4

index 9104a46fbe1658833f35697b5ce66f85534c31af..0f04f5ca65f09f11fcde30e005a8d2346035bb5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-12-28  Colin Watson  <cjwatson@ubuntu.com>
+
+       Backport gnulib fixes for C11.  Fixes Savannah bug #37738.
+
+       * grub-core/gnulib/stdio.in.h (gets): Warn on use only if
+       HAVE_RAW_DECL_GETS.
+       * m4/stdio_h.m4 (gl_STDIO_H): Check for gets.
+
 2012-12-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub.d/20_linux_xen.in: Addmissing assignment to machine.
index 80b9dbfda341628f7db7e77b4697620a4eb5dd27..a8b00c617bcd1706103343384c55958163920950 100644 (file)
@@ -138,10 +138,12 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
 #endif
 
 /* It is very rare that the developer ever has full control of stdin,
-   so any use of gets warrants an unconditional warning.  Assume it is
-   always declared, since it is required by C89.  */
+   so any use of gets warrants an unconditional warning; besides, C11
+   removed it.  */
 #undef gets
+#if HAVE_RAW_DECL_GETS
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
 
 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
index f5650cdeabc6a2f4dcabfe515c4077c398aa587a..8458bec9df6c3b2ea8d0586e246d25e04e0205f9 100644 (file)
@@ -37,7 +37,7 @@ AC_DEFUN([gl_STDIO_H],
   dnl corresponding gnulib module is not in use, and which is not
   dnl guaranteed by C89.
   gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
-    ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
+    ]], [dprintf fpurge fseeko ftello getdelim getline gets popen renameat
     snprintf tmpfile vdprintf vsnprintf])
 ])