diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-02-01 06:58:27 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-02-01 06:58:27 +0000 |
commit | 8c94c75ae756f2f79911197da886e0b247f5fa05 (patch) | |
tree | e8f7f02f5415bb65aea3439c2bb6dfc0a6b67b42 /gcc/java | |
parent | ddf2a54af5d8339de80656f0a9d6a65a4c0cf6a4 (diff) | |
download | gcc-8c94c75ae756f2f79911197da886e0b247f5fa05.zip gcc-8c94c75ae756f2f79911197da886e0b247f5fa05.tar.gz gcc-8c94c75ae756f2f79911197da886e0b247f5fa05.tar.bz2 |
parser.c (cp_parser_primary_expression): Don't complain about floating-point literals in integral constant expressions...
* parser.c (cp_parser_primary_expression): Don't complain about
floating-point literals in integral constant expressions when
!pedantic.
* gjavah.c (print_field_info): Mark static data members of
floating-point type with "__extension__".
From-SVN: r94527
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/gjavah.c | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 9126d9d..287a8cc 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2005-01-31 Mark Mitchell <mark@codesourcery.com> + + * gjavah.c (print_field_info): Mark static data members of + floating-point type with "__extension__". + 2005-02-01 Ranjit Mathew <rmathew@hotmail.com> PR java/9157 diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 1f25ce6..9db37d3 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -768,8 +768,6 @@ print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index, print_cxx_classname (stream, "#define ", jcf, jcf->this_class, 1); fputs ("_", stream); } - else - fputs ("static ", stream); if ((flags & ACC_FINAL) && current_field_value > 0) { @@ -783,7 +781,7 @@ print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index, jint num; int most_negative = 0; if (! flag_jni) - fputs ("const jint ", stream); + fputs ("static const jint ", stream); print_field_name (stream, jcf, name_index, 0); fputs (flag_jni ? " " : " = ", stream); num = JPOOL_INT (jcf, current_field_value); @@ -805,7 +803,7 @@ print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index, jlong num; int most_negative = 0; if (! flag_jni) - fputs ("const jlong ", stream); + fputs ("static const jlong ", stream); print_field_name (stream, jcf, name_index, 0); fputs (flag_jni ? " " : " = ", stream); num = JPOOL_LONG (jcf, current_field_value); @@ -826,7 +824,11 @@ print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index, { jfloat fnum = JPOOL_FLOAT (jcf, current_field_value); if (! flag_jni) - fputs ("const jfloat ", stream); + /* ISO C++ does not allow initialization of a static + data member of floating-point type. Thus, this + code is making use of an undocumented GNU C++ + extension. */ + fputs ("__extension__ static const jfloat ", stream); print_field_name (stream, jcf, name_index, 0); jni_print_float (stream, fnum); } @@ -835,7 +837,11 @@ print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index, { jdouble dnum = JPOOL_DOUBLE (jcf, current_field_value); if (! flag_jni) - fputs ("const jdouble ", stream); + /* ISO C++ does not allow initialization of a static + data member of floating-point type. Thus, this + code is making use of an undocumented GNU C++ + extension. */ + fputs ("__extension__ static const jdouble ", stream); print_field_name (stream, jcf, name_index, 0); jni_print_double (stream, dnum); } |