From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Andrew Haley <aph@redhat.com>
Cc: Richard Guenther <richard.guenther@gmail.com>,
GCC Patches <gcc-patches@gcc.gnu.org>,
GCJ-patches <java-patches@gcc.gnu.org>
Subject: Re: jcf-reader: support for JSR 292 classfile extensions
Date: Wed, 11 Apr 2012 15:57:00 -0000 [thread overview]
Message-ID: <yddzkai5kj0.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <4F858523.8000607@redhat.com> (Andrew Haley's message of "Wed, 11 Apr 2012 14:20:35 +0100")
[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]
Andrew Haley <aph@redhat.com> writes:
> On 04/11/2012 01:43 PM, Richard Guenther wrote:
>> This breaks bootstrap for me:
>>
>> In file included from
>> /space/rguenther/src/svn/trunk/gcc/java/jcf-parse.c:1009:0:
>> /space/rguenther/src/svn/trunk/gcc/java/jcf-reader.c:550:1: error:
>> 'int jcf_parse_bootstrap_methods(JCF*, int)' defined but not used
>> [-Werror=unused-function]
>> jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED)
>> ^
>> cc1plus: all warnings being treated as errors
>> make[3]: *** [java/jcf-parse.o] Error 1
>> make[3]: *** Waiting for unfinished jobs....
>>
>
> Sorry.
It also broke Java bootstrap on 32-bit targets:
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c: In function 'void print_constant(std::FILE*, JCF*, int, int)':
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:929:64: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format]
fprintf (out, "Fieldref: %ld=", JPOOL_USHORT2 (jcf, index));
^
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:936:65: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format]
fprintf (out, "Methodref: %ld=", JPOOL_USHORT2 (jcf, index));
^
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:941:74: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format]
fprintf (out, "InterfaceMethodref: %ld=", JPOOL_USHORT2 (jcf, index));
^
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:949:62: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format]
fprintf (out, "MethodType %ld: ", JPOOL_USHORT1 (jcf, index));
^
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:957:68: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format]
fprintf (out, "bootstrap_method: %ld ", JPOOL_USHORT1 (jcf, index));
^
The following patch got me into stage3 on i386-pc-solaris2.10 and
amd64-pc-solaris2.10.
Ok for mainline?
Rainer
2012-04-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* jcf-dump.c (print_constant): Cast JPOOL_USHORT2, JPOOL_USHORT1
results to long to match formats.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: java-jcf-dump.patch --]
[-- Type: text/x-patch, Size: 1939 bytes --]
# HG changeset patch
# Parent 94918a528698bab552dc2f8be5c1666444afca67
Fix java bootstrap on 32-bit targets
diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c
--- a/gcc/java/jcf-dump.c
+++ b/gcc/java/jcf-dump.c
@@ -926,19 +926,20 @@ print_constant (FILE *out, JCF *jcf, int
case 3:
case 4:
if (verbosity > 0)
- fprintf (out, "Fieldref: %ld=", JPOOL_USHORT2 (jcf, index));
+ fprintf (out, "Fieldref: %ld=", (long) JPOOL_USHORT2 (jcf, index));
print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0);
case 5:
case 6:
case 7:
case 8:
if (verbosity > 0)
- fprintf (out, "Methodref: %ld=", JPOOL_USHORT2 (jcf, index));
+ fprintf (out, "Methodref: %ld=", (long) JPOOL_USHORT2 (jcf, index));
print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0);
break;
case 9:
if (verbosity > 0)
- fprintf (out, "InterfaceMethodref: %ld=", JPOOL_USHORT2 (jcf, index));
+ fprintf (out, "InterfaceMethodref: %ld=",
+ (long) JPOOL_USHORT2 (jcf, index));
print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0);
break;
}
@@ -946,7 +947,7 @@ print_constant (FILE *out, JCF *jcf, int
}
case CONSTANT_MethodType:
if (verbosity > 0)
- fprintf (out, "MethodType %ld: ", JPOOL_USHORT1 (jcf, index));
+ fprintf (out, "MethodType %ld: ", (long) JPOOL_USHORT1 (jcf, index));
print_signature (out, jcf, JPOOL_USHORT1 (jcf, index), 0);
break;
case CONSTANT_InvokeDynamic:
@@ -954,7 +955,8 @@ print_constant (FILE *out, JCF *jcf, int
uint16 name_and_type = JPOOL_USHORT2 (jcf, index);
if (verbosity > 0)
fprintf (out, "InvokeDynamic: ");
- fprintf (out, "bootstrap_method: %ld ", JPOOL_USHORT1 (jcf, index));
+ fprintf (out, "bootstrap_method: %ld ",
+ (long) JPOOL_USHORT1 (jcf, index));
if (verbosity == 2)
fprintf (out, " name_and_type: %d=<", name_and_type);
print_constant_terse (out, jcf, name_and_type, CONSTANT_NameAndType);
[-- Attachment #3: Type: text/plain, Size: 144 bytes --]
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
next prev parent reply other threads:[~2012-04-11 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 10:22 Andrew Haley
2012-04-11 12:43 ` Richard Guenther
2012-04-11 13:21 ` Andrew Haley
2012-04-11 15:57 ` Rainer Orth [this message]
2012-04-11 16:09 ` Andrew Haley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yddzkai5kj0.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
--to=ro@cebitec.uni-bielefeld.de \
--cc=aph@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).