summaryrefslogtreecommitdiffstats
path: root/0001-Fix-compile-with-GCC-5-Werror.patch
blob: c1975e1a8ccc9e1d29ceae5c3708b05ccde5dc8f (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 8b8952064cfacf91b18aed37fbd44f621edb6941 Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Thu, 11 Feb 2016 20:16:06 -0600
Subject: [PATCH 1/4] Fix compile with GCC 5 -Werror

	newlib/libc/
	* stdio64/freopen64.c: Include <string.h> for memset().
	* stdlib/quick_exit.c: Include <unistd.h> for _exit().
	* string/gnu_basename.c (__gnu_basename): Fix discarded const
	qualifier warning.
	* stdlib/strtold.c: Include "mprec.h" for _strtorx_r().

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
 newlib/libc/stdio64/freopen64.c   | 1 +
 newlib/libc/stdlib/quick_exit.c   | 1 +
 newlib/libc/stdlib/strtold.c      | 2 ++
 newlib/libc/string/gnu_basename.c | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c
index 8a069d5..f7df354 100644
--- a/newlib/libc/stdio64/freopen64.c
+++ b/newlib/libc/stdio64/freopen64.c
@@ -74,6 +74,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
 
 #include <time.h>
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
diff --git a/newlib/libc/stdlib/quick_exit.c b/newlib/libc/stdlib/quick_exit.c
index fc43571..1d6fb23 100644
--- a/newlib/libc/stdlib/quick_exit.c
+++ b/newlib/libc/stdlib/quick_exit.c
@@ -28,6 +28,7 @@
  */
 
 #include <stdlib.h>
+#include <unistd.h>
 #include <sys/lock.h>
 
 /**
diff --git a/newlib/libc/stdlib/strtold.c b/newlib/libc/stdlib/strtold.c
index 96254eb..a6d415d 100644
--- a/newlib/libc/stdlib/strtold.c
+++ b/newlib/libc/stdlib/strtold.c
@@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include <stdlib.h>
 #include "local.h"
+#include "mprec.h"
+#undef FLT_ROUNDS
 
 #ifdef _HAVE_LONG_DOUBLE
 
diff --git a/newlib/libc/string/gnu_basename.c b/newlib/libc/string/gnu_basename.c
index 46b92d0..90e22cc 100644
--- a/newlib/libc/string/gnu_basename.c
+++ b/newlib/libc/string/gnu_basename.c
@@ -20,7 +20,7 @@ _DEFUN (__gnu_basename, (path),
   char *p;
   if ((p = strrchr (path, '/')))
     return p + 1;
-  return path;
+  return (char *) path;
 }
 
 #endif /* !_NO_BASENAME  */
-- 
2.7.4