This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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] |
[Removed libstdc++; Added java-patches.] On Mon, 31 Jan 2005 22:21:14 -0800, Mark Mitchell <mark@codesourcery.com> wrote: > Ranjit Mathew wrote: > > >>> static const jfloat DEFAULT_LOAD_FACTOR = 0x1.800000p-1f; > >> > >>Ugh. That's invalid C++. > > > > > > Then that should have been a different error, no? :-) > > (But I'm curious - and an ignoramus - why is that invalid?) > > See this morning's discussion on the GCC mailing list. Thanks for the pointer. > The code generate by gjavah is invalid on two counts: (1) you can't have > an in-class initialization a static data member of non-integral type, > and (2) even for a static data member with integral type, the > initializer has to be an integral constant expression, which a > floating-point literal is not. I have created PR java/19738 for this issue. In the interim, I find that the attached patch fixes the issue for me and allows me to finish bootstrap. It also does not introduce any regressions in the testsuite. It is "bogus" in the sense that it just disables the initialisation for static final real fields for CNI (and not JNI). That said, I am not completely sure of the mechanics of the original code either - the final (const) field would have been initialised by the "Java side" too - so why do we need to initialise it in C++? I'm sure I'm missing something... Ranjit. -- Ranjit Mathew Email: rmathew AT gmail DOT com Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/
Attachment:
gjavah.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |