Add missing includes.

Message ID 20190325153353.146530-1-ams@codesourcery.com
State Accepted
Commit e8b23909e4f458b923595872719523b2293bd74e
Headers show
Series
  • Add missing includes.
Related show

Commit Message

Andrew Stubbs March 25, 2019, 3:33 p.m.
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(-)

Comments

Corinna Vinschen March 25, 2019, 3:45 p.m. | #1
On Mar 25 15:33, Andrew Stubbs wrote:
> 

> 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?



Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

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>