This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Kawa 1.13 compilation problem, possible regression
- From: Per Bothner <per at bothner dot com>
- To: Matthieu Vachon <matthieu dot o dot vachon at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Sun, 05 May 2013 00:42:56 -0700
- Subject: Re: Kawa 1.13 compilation problem, possible regression
- References: <CAOTvmom6rqn9_fgDTjOr=Hfe-jLsvso8ii5KgnT2CgTYYmo0XQ at mail dot gmail dot com> <511026D7 dot 5030007 at bothner dot com> <51551844 dot 5080201 at bothner dot com> <CAOTvmoknAS5EQc0JpemSPnLSRKoPnWgMBQbe5ovbu=n74bZSuw at mail dot gmail dot com> <CAOTvmomjQAq8uOa3UD2Yzs+n+P4C5bpiT9yDFY0stepueWYKpQ at mail dot gmail dot com>
On 05/04/2013 08:32 PM, Matthieu Vachon wrote:
Hi Per,
I tried to compile latest version (r7491) but was not able to do so
under java5. With java6, it went well and didn't hit any problems.
Here the failing bit when compiling with java5:
[kawac] (compiling c:\Nu\kawa\kawa\lib\rnrs\unicode.scm to
kawa.lib.rnrs.unicode)
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
I checked the code in `unicode.scm` but could find something wrong
from my point of view.
The reason is that on java5 the cond-expand tag
string-normalize-unicode is false, so we get the equivalent of:
(define (string-normalize-nfd (str :: string)) :: string
(error "unicode string normalization not available"))
The complaint is that the never-returns value of is incompatible
with the return value of string. Which is true - but we should
allow it anyway. And that was the intention, but there was
a little bug - incorrect variable reuse. Should be fixed
in the attached patch.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
Index: gnu/expr/ChainLambdas.java
===================================================================
--- gnu/expr/ChainLambdas.java (revision 7491)
+++ gnu/expr/ChainLambdas.java (working copy)
@@ -50,21 +50,21 @@
}
protected Expression visitApplyExp(ApplyExp exp, ScopeExp scope) {
- Expression e = visit(exp.func, scope);
+ Expression f = visit(exp.func, scope);
Expression[] args = exp.args;
int nargs = args.length;
- exp.func = e;
- if (e.neverReturns()) {
+ exp.func = f;
+ if (f.neverReturns()) {
maybeWarnUnreachable(nargs > 0 ? args[0] : exp);
- return e;
+ return f;
}
for (int i = 0; i < nargs; i++) {
- e = visit(args[i], scope);
+ Expression e = visit(args[i], scope);
if (e.neverReturns()
// It seems best to silently allow converting never-returns
// to any type. For example it useful for stub procedures
// that throw an "unimplemented" exception.
- && ! (e.valueIfConstant() instanceof Convert)) {
+ && ! (f.valueIfConstant() instanceof Convert)) {
Expression[] xargs = new Expression[i+2];
xargs[0] = exp.func;
System.arraycopy(args, 0, xargs, 1, i+1);