This is the mail archive of the gcc-bugs@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]

Re: g++ -vs Java boolean


Mark Mitchell <mark@codesourcery.com> writes:
> You seem to imply that mangling need not be uniform across platforms.

I said it was desirable - but not absolutely required.  But keeping
it the same on all platforms makes demangling simpler and more
robust.  Having Java 'int' and C++ 'int' mangle the same is
less essential - but convenient.  Note we also have an existing,
documented, working mangling scheme for both C++ and Java, and it
has the desirable properties I've mentioned.  It seems like there
needs to be a really strong argument to give that up.

> If that's true, I recommend removing this stuff from cc1plus
> altogether; the semantics are ill-defined.

In what respect?  I can see that overload resolution might depend
on the platform.  I.e. it might be unclear whether foo(jlong) conflicts
with foo(int) and/or foo(long) - but frankly I don't care.  All I care
is that it is clear that foo(int) does not conflict with foo(long) and
that foo(jint) does not conflict with foo(jlong);  whether foo(int)
conflicts with foo(jint) is not really interesting.  In fact, I'd like to
prohibit overloading where two different methods with the same name and
arity have different "Java-type-ness" for a given argument.  I.e. where
there is a method foo such that parameter #i is a Java type (has
TYPE_FOR_JAVA set) if there is another method foo with parameter #i
does is *not* a Java type.

> Another alternative is to simply consider Tom's case "not a bug," or
> do the `jtrue' bit.

Well, with the "new ABI" (i.e. assuming sizeof(bool)==1) we could just:
        typedef bool jboolean;
except it may make it harder to do the error-checking I mentioned.
CNI (the C++ Native Interface to Java) sort of requires the "new ABI" anyway;
at least it assumes the thunk-based vtable format.
-- 
	--Per Bothner
bothner@pacbell.net  per@bothner.com   http://home.pacbell.net/bothner/


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