This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
avoid compiler warning in getopt.h
- From: Eric Blake <ebb9 at byu dot net>
- To: newlib at sources dot redhat dot com
- Date: Sat, 26 Sep 2009 11:46:41 -0600
- Subject: avoid compiler warning in getopt.h
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OK to apply, to avoid warnings about declaring the unused type getopt_data
inside a function argument list?
2009-09-26 Eric Blake <ebb9@byu.net>
* libc/include/getopt.h (__getopt_r, __getopt_long_r)
(__getopt_long_only_r): Protect declarations, to avoid compiler
warning.
- --
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/
iEYEARECAAYFAkq+U4EACgkQ84KuGfSFAYBOAwCfWY7ljuKi1vDUNbvP/+C5pBNU
zj4An34uj/0cJb3k6arJuB3uVyDwmci4
=smE2
-----END PGP SIGNATURE-----
diff --git a/newlib/libc/include/getopt.h b/newlib/libc/include/getopt.h
index 13cf99c..ba8da4a 100644
--- a/newlib/libc/include/getopt.h
+++ b/newlib/libc/include/getopt.h
@@ -164,6 +164,7 @@ extern "C"
(int __argc, char *const __argv[], const char *__shortopts,
const struct option * __longopts, int *__longind));
+#ifdef __need_getopt_newlib
int _EXFUN (__getopt_r,
(int __argc, char *const __argv[], const char *__optstring,
struct getopt_data * __data));
@@ -177,6 +178,7 @@ extern "C"
(int __argc, char *const __argv[], const char *__shortopts,
const struct option * __longopts, int *__longind,
struct getopt_data * __data));
+#endif /* __need_getopt_newlib */
#ifdef __cplusplus
};