This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
fix getsubopt declaration
- From: Eric Blake <ebb9 at byu dot net>
- To: newlib at sources dot redhat dot com
- Date: Mon, 21 Dec 2009 22:11:21 -0700
- Subject: fix getsubopt declaration
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Any objections to this? POSIX 2008 requires getsubopt in <stdlib.h> (even
though it also requires getopt in <unistd.h> - what a historical wart).
2009-12-22 Eric Blake <ebb9@byu.net>
* libc/include/sys/unistd.h (suboptarg, getsubopt): Move...
* libc/include/stdlib.h: ...here, to match POSIX for getsubopt.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkswVPkACgkQ84KuGfSFAYDVwgCeP4PCfcFs8wwRyXnJIk0mgs4g
ChIAn1o912ryNC8lOlPfx0kDoUHrp7+G
=H8QO
-----END PGP SIGNATURE-----
>From ddf936891b7adf6fe397c81cfb8518b869e2a88d Mon Sep 17 00:00:00 2001
From: Eric Blake <ebb9@byu.net>
Date: Mon, 21 Dec 2009 22:09:55 -0700
Subject: [PATCH] fix getsubopt header
---
newlib/libc/include/stdlib.h | 4 ++++
newlib/libc/include/sys/unistd.h | 3 ---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h
index 82a2207..b33503d 100644
--- a/newlib/libc/include/stdlib.h
+++ b/newlib/libc/include/stdlib.h
@@ -83,6 +83,10 @@ char * _EXFUN(getenv,(const char *__string));
char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
char * _EXFUN(_findenv,(_CONST char *, int *));
char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
+#ifndef __STRICT_ANSI__
+extern char *suboptarg; /* getsubopt(3) external variable */
+int _EXFUN(getsubopt,(char **, char * const *, char **));
+#endif
long _EXFUN(labs,(long));
ldiv_t _EXFUN(ldiv,(long __numer, long __denom));
_PTR _EXFUN_NOTHROW(malloc,(size_t __size));
diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 80c35da..4193002 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -191,9 +191,6 @@ extern int optreset; /* getopt(3) external variable */
#ifndef _POSIX_SOURCE
pid_t _EXFUN(vfork, (void ));
-
-extern char *suboptarg; /* getsubopt(3) external variable */
-int getsubopt(char **, char * const *, char **);
#endif /* _POSIX_SOURCE */
#ifdef _COMPILING_NEWLIB
--
1.6.5.rc1