This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

remove libiberty/getopt.c warnings


This patch silences some warnings when compiling libiberty/getopt.c.
Okay to commit?

Ben

2004-12-08  Ben Elliston  <bje@au.ibm.com>

	* getopt.c: Include "ansidecl.h" for the ATTRIBUTE_UNUSED macro.
	(_getopt_initialize): Annotate argc and argv parameters as unused.

Index: getopt.c
===================================================================
RCS file: /cvs/src/src/libiberty/getopt.c,v
retrieving revision 1.4
diff -u -r1.4 getopt.c
--- getopt.c    15 Apr 2003 15:27:20 -0000      1.4
+++ getopt.c    7 Dec 2004 23:21:43 -0000
@@ -3,8 +3,8 @@
    "Keep this file name-space clean" means, talk to drepper@gnu.org
    before changing it!
 
-   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
-       Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+       1996, 1997, 1998, 2004 Free Software Foundation, Inc.
 
    NOTE: This source is derived from an old version taken from the GNU C
    Library (glibc).
@@ -90,6 +90,9 @@
 # endif
 #endif
 
+/* Needed for ATTRIBUTE_UNUSED.  */
+#include <ansidecl.h>
+
 /* This version of `getopt' appears to the caller like standard Unix `getopt'
    but it behaves differently for the user, since it allows the user
    to intersperse the options with the other arguments.
@@ -393,8 +396,8 @@
 #endif
 static const char *
 _getopt_initialize (argc, argv, optstring)
-     int argc;
-     char *const *argv;
+     int argc ATTRIBUTE_UNUSED;
+     char *const *argv ATTRIBUTE_UNUSED;
      const char *optstring;
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]