This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Add missing includes.
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: <newlib at sourceware dot org>
- Date: Mon, 25 Mar 2019 15:33:53 +0000
- Subject: [PATCH] Add missing includes.
These missing includes were causing build warnings, but also a real bug in
which the "size" parameter to "write" was being passed in 32-bit, whereas it
ought to be 64-bit. This led to intermittent bad behaviour.
---
Built and regtested for AMD GCN.
OK?
--
Andrew Stubbs
Mentor Graphics / CodeSourcery
newlib/libc/machine/amdgcn/abort.c | 2 +-
newlib/libc/machine/amdgcn/getreent.c | 1 +
newlib/libc/sys/amdgcn/fstat.c | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/newlib/libc/machine/amdgcn/abort.c b/newlib/libc/machine/amdgcn/abort.c
index ccbca726a..ca9a0a33f 100644
--- a/newlib/libc/machine/amdgcn/abort.c
+++ b/newlib/libc/machine/amdgcn/abort.c
@@ -13,7 +13,7 @@
* they apply.
*/
-#include <stdlib.h>
+#include <unistd.h>
#include <signal.h>
#include "exit-value.h"
diff --git a/newlib/libc/machine/amdgcn/getreent.c b/newlib/libc/machine/amdgcn/getreent.c
index acf10a97f..5a28aa406 100644
--- a/newlib/libc/machine/amdgcn/getreent.c
+++ b/newlib/libc/machine/amdgcn/getreent.c
@@ -3,6 +3,7 @@
#include <reent.h>
#include <stdint.h>
#include <stdlib.h>
+#include <unistd.h>
/* Copied from the HSA documentation. */
typedef struct hsa_signal_s {
diff --git a/newlib/libc/sys/amdgcn/fstat.c b/newlib/libc/sys/amdgcn/fstat.c
index b78715857..2526967ef 100644
--- a/newlib/libc/sys/amdgcn/fstat.c
+++ b/newlib/libc/sys/amdgcn/fstat.c
@@ -13,6 +13,8 @@
* they apply.
*/
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>