This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[ecj] Patch: FYI: fix jcf-dump warnings
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 07 Jul 2006 18:25:48 -0600
- Subject: [ecj] Patch: FYI: fix jcf-dump warnings
- Reply-to: tromey at redhat dot com
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); \