This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
-Wundef problems in getopt.h,libiberty.h
- From: Doug Evans <dje at transmeta dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 30 Jul 2002 18:38:15 -0700
- Subject: -Wundef problems in getopt.h,libiberty.h
If you compile with -Wundef, getopt.h and libiberty.h trigger warnings.
2002-07-30 Doug Evans <dje@casey.transmeta.com>
* getopt.h: Protect references to HAVE_DECL_GETOPT in case
user compiles with -Wundef.
* libiberty.h: Ditto with HAVE_DECL_BASENAME.
Index: getopt.h
===================================================================
RCS file: /proj/sw/astro/cvsroot/src/tools/fsf/include/getopt.h,v
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.1 getopt.h
--- getopt.h 2002/07/29 20:25:36 1.2.4.1
+++ getopt.h 2002/07/31 01:33:41
@@ -105,7 +105,7 @@ struct option
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
-#if !HAVE_DECL_GETOPT
+#if ! defined (HAVE_DECL_BASENAME) || !HAVE_DECL_GETOPT
#if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
Index: libiberty.h
===================================================================
RCS file: /proj/sw/astro/cvsroot/src/tools/fsf/include/libiberty.h,v
retrieving revision 1.8.4.1
diff -u -p -r1.8.4.1 libiberty.h
--- libiberty.h 2002/07/29 20:25:36 1.8.4.1
+++ libiberty.h 2002/07/31 01:33:00
@@ -73,7 +73,7 @@ extern char **dupargv PARAMS ((char **))
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
-#if !HAVE_DECL_BASENAME
+#if ! defined (HAVE_DECL_BASENAME) || !HAVE_DECL_BASENAME
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (HAVE_DECL_BASENAME)
extern char *basename PARAMS ((const char *));
#else