This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Patch: unused arguments


Hi list,


I just wrote a little patch to suppress two warnings about unused arguments.
This generally adds "__attribute__((unused))". This gives no warning when the 
argument is used.

Okay to commit to trunk ?


Michael


2004-01-28  Michael Koch  <konqueror@gmx.de>

	* jni.cc (_Jv_LookupJNIMethod): Mark 'args_size' unused.
	* verify.cc (debug_print): Mark 'fmt' unused.

Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.80
diff -u -b -B -r1.80 jni.cc
--- jni.cc	18 Nov 2003 17:56:33 -0000	1.80
+++ jni.cc	28 Jan 2004 20:51:06 -0000
@@ -2051,7 +2051,8 @@
 // This is `extern "C"' because the compiler uses it.
 extern "C" void *
 _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
-		     _Jv_Utf8Const *signature, int args_size)
+		     _Jv_Utf8Const *signature,
+		     __attribute__((unused)) int args_size)
 {
   char buf[10 + 6 * (name->length + signature->length) + 12];
   int long_start;
Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.60
diff -u -b -B -r1.60 verify.cc
--- verify.cc	23 Jan 2004 02:49:56 -0000	1.60
+++ verify.cc	28 Jan 2004 20:51:07 -0000
@@ -40,7 +40,7 @@
   __attribute__ ((format (printf, 1, 2)));
 
 static inline void
-debug_print (const char *fmt, ...)
+debug_print (__attribute__((unused)) const char *fmt, ...)
 {
 #ifdef VERIFY_DEBUG
   va_list ap;

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