summaryrefslogtreecommitdiffstats
path: root/0016-fix-some-implicit-declaration-warnings.patch
blob: 0c0b4a20c704ec8c585e9a7b5ac064940352a1d6 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 9acb3806f55fe198543405988601fd90945f00ac Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Sat, 28 Jun 2014 10:08:25 +0800
Subject: [PATCH 16/21] fix some implicit declaration warnings

---
 libiberty/aclocal.m4 | 6 +++++-
 libiberty/configure  | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index bf8a907..6b5e66c 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -15,6 +15,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
 /* Test by Jim Wilson and Kaveh Ghazi.
    Check whether strncmp reads past the end of its string parameters. */
 #include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
@@ -147,7 +149,9 @@ if test $ac_cv_os_cray = yes; then
 fi
 
 AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
+[AC_TRY_RUN([
+#include <stdlib.h>
+find_stack_direction ()
 {
   static char *addr = 0;
   auto char dummy;
diff --git a/libiberty/configure b/libiberty/configure
index da2df4e..f8bb482 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -6390,6 +6390,7 @@ else
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <stdlib.h>
 find_stack_direction ()
 {
   static char *addr = 0;
@@ -7200,6 +7201,8 @@ else
 /* Test by Jim Wilson and Kaveh Ghazi.
    Check whether strncmp reads past the end of its string parameters. */
 #include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-- 
2.4.5