Package: libprelude / 1.0.0-11.9

003-fix-gnulib-gets Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: Avoid assuming that gets is declared
Author: Colin Watson <cjwatson@ubuntu.com>
Origin: backport, http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=66712c23388e93e5c518ebc8515140fa0c807348
Forwarded: no
Last-Update: 2012-11-21

Index: libprelude/libmissing/m4/stdio_h.m4
===================================================================
--- libprelude.orig/libmissing/m4/stdio_h.m4	2011-06-11 16:28:12.000000000 +0200
+++ libprelude/libmissing/m4/stdio_h.m4	2012-12-02 18:45:07.846345125 +0100
@@ -34,9 +34,9 @@
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
-  dnl guaranteed by C89.
+  dnl guaranteed by C89 and C11.
   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 vdprintf vsnprintf])
 ])
 
Index: libprelude/libmissing/stdio.in.h
===================================================================
--- libprelude.orig/libmissing/stdio.in.h	2011-06-11 16:27:54.000000000 +0200
+++ libprelude/libmissing/stdio.in.h	2012-12-02 18:43:47.198329027 +0100
@@ -114,10 +114,12 @@
 #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@