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]

[ecj] Patch: FYI: fix jcf-dump warnings


I'm checking this in on the gcj-eclipse branch.

Andrew Hughes pointed out a couple of warnings when compiling jcf-dump.c.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* jcf-dump.c (HANDLE_ENCLOSINGMETHOD_ATTRIBUTE): Declare locals
	earlier.
	(HANDLE_SIGNATURE_ATTRIBUTE): Likewise.

Index: jcf-dump.c
===================================================================
--- jcf-dump.c	(revision 115280)
+++ jcf-dump.c	(working copy)
@@ -384,9 +384,10 @@
   if (c != '\r' && c != '\n') fputc('\n', out); }
 
 #define HANDLE_ENCLOSINGMETHOD_ATTRIBUTE()				\
-{ COMMON_HANDLE_ATTRIBUTE(jcf, attribute_name, attribute_length);	\
-  uint16 class_index = JCF_readu2 (jcf);				\
-  uint16 method_index = JCF_readu2 (jcf);				\
+  { uint16 class_index, method_index;					\
+  COMMON_HANDLE_ATTRIBUTE(jcf, attribute_name, attribute_length);	\
+  class_index = JCF_readu2 (jcf);					\
+  method_index = JCF_readu2 (jcf);					\
   fprintf (out, "\n  Class: ");						\
   print_constant_terse_with_index (out, jcf, class_index, CONSTANT_Class); \
   fprintf (out, "\n  Method: ");					\
@@ -397,8 +398,9 @@
 
 #define HANDLE_SIGNATURE_ATTRIBUTE()					\
 {									\
+  uint16 signature;							\
   COMMON_HANDLE_ATTRIBUTE(jcf, attribute_name, attribute_length);	\
-  uint16 signature = JCF_readu2 (jcf);					\
+  signature = JCF_readu2 (jcf);						\
   fprintf (out, "\n  Value: ");						\
   print_constant_terse_with_index (out, jcf, signature, CONSTANT_Utf8);	\
   fputc ('\n', out);							\


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