[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hurd-bug
Subject:    [PATCH] include <stdlib.h> or <mach.h> where needed
From:       Pino Toscano <toscano.pino () tiscali ! it>
Date:       2013-02-25 21:01:35
Message-ID: 201302252201.41301.toscano.pino () tiscali ! it
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi,

attached a small patch to include <stdlib.h> or <mach.h> in few places 
where they were needed, to fix the compilation warnings about lacks of 
prototypes.

May I push it?

-- 
Pino Toscano

["0001-Include-stdlib.h-or-mach.h-where-needed.patch" (text/x-patch)]

From e652274733eeba8a753623dc61bd781c35f93c93 Mon Sep 17 00:00:00 2001
From: Pino Toscano <toscano.pino@tiscali.it>
Date: Mon, 25 Feb 2013 21:51:35 +0100
Subject: [PATCH] Include <stdlib.h> or <mach.h> where needed

cthreads.h includes both <stdlib.h> and <mach.h>, while pthreads.h does not;
with the switch to pthreads, their lack causes prototype compilation warnings
for malloc/calloc/free/abort, and mach_task_self/mach_reply_port/etc in few places.

* console-client/vga-support.c: Include <stdlib.h>.
* libiohelp/iouser-dup.c: Likewise.
* libiohelp/iouser-free.c: Likewise.
* libiohelp/iouser-reauth.c: Likewise.
* libiohelp/return-buffer.c: Likewise.
* libiohelp/shared.c: Likewise.
* pflocal/connq.c: Likewise.
* nfsd/cache.c: Include <mach.h>.
---
 console-client/vga-support.c |    1 +
 libiohelp/iouser-dup.c       |    2 ++
 libiohelp/iouser-free.c      |    2 ++
 libiohelp/iouser-reauth.c    |    1 +
 libiohelp/return-buffer.c    |    1 +
 libiohelp/shared.c           |    2 ++
 nfsd/cache.c                 |    1 +
 pflocal/connq.c              |    1 +
 8 files changed, 11 insertions(+)

diff --git a/console-client/vga-support.c b/console-client/vga-support.c
index 2837a6e..130bcc5 100644
--- a/console-client/vga-support.c
+++ b/console-client/vga-support.c
@@ -26,6 +26,7 @@
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include "vga-hw.h"
 #include "vga-support.h"
diff --git a/libiohelp/iouser-dup.c b/libiohelp/iouser-dup.c
index 9158d0c..ae55ad1 100644
--- a/libiohelp/iouser-dup.c
+++ b/libiohelp/iouser-dup.c
@@ -17,6 +17,8 @@
 
 #include "iohelp.h"
 
+#include <stdlib.h>
+
 error_t
 iohelp_dup_iouser (struct iouser **clone, struct iouser *iouser)
 {
diff --git a/libiohelp/iouser-free.c b/libiohelp/iouser-free.c
index 4cfdc95..19153da 100644
--- a/libiohelp/iouser-free.c
+++ b/libiohelp/iouser-free.c
@@ -17,6 +17,8 @@
 
 #include "iohelp.h"
 
+#include <stdlib.h>
+
 void
 iohelp_free_iouser (struct iouser *iouser)
 {
diff --git a/libiohelp/iouser-reauth.c b/libiohelp/iouser-reauth.c
index 4125cfb..9edab7c 100644
--- a/libiohelp/iouser-reauth.c
+++ b/libiohelp/iouser-reauth.c
@@ -18,6 +18,7 @@
 #include "iohelp.h"
 #include <hurd/auth.h>
 #include <sys/mman.h>
+#include <stdlib.h>
 
 /* Conduct a reauthentication transaction, returning a new iouser.
    AUTHSERVER is the I/O servers auth port.  The rendezvous port
diff --git a/libiohelp/return-buffer.c b/libiohelp/return-buffer.c
index 3095dfb..e186698 100644
--- a/libiohelp/return-buffer.c
+++ b/libiohelp/return-buffer.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <mach.h>
 #include <sys/mman.h>
+#include <stdlib.h>
 
 #include "iohelp.h"
 
diff --git a/libiohelp/shared.c b/libiohelp/shared.c
index 082b526..b31a717 100644
--- a/libiohelp/shared.c
+++ b/libiohelp/shared.c
@@ -18,6 +18,8 @@
 
 #include "iohelp.h"
 
+#include <stdlib.h>
+
 /* These definitions exist to satisfy the linker. */
 
 void __attribute__ ((weak))
diff --git a/nfsd/cache.c b/nfsd/cache.c
index 5b94e71..778f557 100644
--- a/nfsd/cache.c
+++ b/nfsd/cache.c
@@ -27,6 +27,7 @@
 #include <pthread.h>
 #include <hurd/io.h>
 #include <hurd/auth.h>
+#include <mach.h>
 #include "nfsd.h"
 
 
diff --git a/pflocal/connq.c b/pflocal/connq.c
index bf93765..ab2b3a5 100644
--- a/pflocal/connq.c
+++ b/pflocal/connq.c
@@ -20,6 +20,7 @@
 
 #include <pthread.h>
 #include <assert.h>
+#include <stdlib.h>
 
 #include "connq.h"
 
-- 
1.7.10.4


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic