[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
compilation warning in argp-help
From: |
Eric Blake |
Subject: |
compilation warning in argp-help |
Date: |
Wed, 15 Feb 2006 06:29:29 -0700 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It is possible to get an unused variable warning in __argp_failure on
platforms without strerror_r; or when configuring with CFLAGS='-Wall
- -Werror' where the HAVE_DECL_STRERROR_R test mistakenly fails due to an
unused variable warning, getting set to 0.
configure:11302: checking whether strerror_r is declared
configure:11326: gcc -c -g2 -Wall -Werror conftest.c >&5
conftest.c: In function `main':
conftest.c:135: warning: unused variable `p'
configure:11332: $? = 1
...
| int
| main ()
| {
| #ifndef strerror_r
| char *p = (char *) strerror_r;
| #endif
|
| ;
| return 0;
| }
I will be sending a followup report to autoconf about the unused variable
warning evoked in AC_FUNC_STRERROR_R.
2006-02-15 Eric Blake <address@hidden>
* argp-help.c (__argp_failure) [!defined USE_IN_LIBIO && !_LIBC
&& !HAVE_DECL_STRERROR_R]: Avoid unused variable.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFD8yy584KuGfSFAYARAvgpAJ9welva9kilBEroPG+7+vSuWkz7hACeMnMl
XTNyqNQv6BOdONZAiRG4tJ0=
=FVib
-----END PGP SIGNATURE-----
Index: lib/argp-help.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/argp-help.c,v
retrieving revision 1.21
diff -u -p -r1.21 argp-help.c
--- lib/argp-help.c 21 Jan 2006 19:06:40 -0000 1.21
+++ lib/argp-help.c 15 Feb 2006 13:12:38 -0000
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <address@hidden>.
@@ -1882,7 +1882,9 @@ __argp_failure (const struct argp_state
if (errnum)
{
+#if defined USE_IN_LIBIO || _LIBC || HAVE_DECL_STRERROR_R
char buf[200];
+#endif
#ifdef USE_IN_LIBIO
if (_IO_fwide (stream, 0) > 0)
- compilation warning in argp-help,
Eric Blake <=