avoid compiler warning in getopt.h

View: New views
3 Messages — Rating Filter:   Alert me  

avoid compiler warning in getopt.h

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----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@...>

        * 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@...
-----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
 };

Re: avoid compiler warning in getopt.h

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/26/2009 11:46 AM:
> OK to apply, to avoid warnings about declaring the unused type getopt_data
> inside a function argument list?
>
> 2009-09-26  Eric Blake  <ebb9@...>
>
> * libc/include/getopt.h (__getopt_r, __getopt_long_r)
> (__getopt_long_only_r): Protect declarations, to avoid compiler
> warning.

Ping.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----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/

iEYEARECAAYFAkrNWn4ACgkQ84KuGfSFAYDx0wCghJKZ6FpuGDfeeWWYl8Ia7tDK
AfsAoKh1ZYt3xkkpCC5+2otLqUhWVXEW
=0kWo
-----END PGP SIGNATURE-----

Re: avoid compiler warning in getopt.h

by Jeff Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Patch applied.

-- Jeff J.

On 07/10/09 11:20 PM, Eric Blake wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Eric Blake on 9/26/2009 11:46 AM:
>> OK to apply, to avoid warnings about declaring the unused type getopt_data
>> inside a function argument list?
>>
>> 2009-09-26  Eric Blake<ebb9@...>
>>
>> * libc/include/getopt.h (__getopt_r, __getopt_long_r)
>> (__getopt_long_only_r): Protect declarations, to avoid compiler
>> warning.
>
> Ping.
>
> - --
> Don't work too hard, make some time for fun as well!
>
> Eric Blake             ebb9@...
> -----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/
>
> iEYEARECAAYFAkrNWn4ACgkQ84KuGfSFAYDx0wCghJKZ6FpuGDfeeWWYl8Ia7tDK
> AfsAoKh1ZYt3xkkpCC5+2otLqUhWVXEW
> =0kWo
> -----END PGP SIGNATURE-----