aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-01-14 09:37:09 -0800
committerPer Bothner <bothner@gcc.gnu.org>2001-01-14 09:37:09 -0800
commitd9da31dd9a2c85e33e8f997b88eccf759b2a76c9 (patch)
tree43d8645429e21dac0961bb4257cc655ee95b557c /gcc
parent6de8f7fc965d7306fa28f67ad9b5da13b59a9c19 (diff)
downloadgcc-d9da31dd9a2c85e33e8f997b88eccf759b2a76c9.zip
gcc-d9da31dd9a2c85e33e8f997b88eccf759b2a76c9.tar.gz
gcc-d9da31dd9a2c85e33e8f997b88eccf759b2a76c9.tar.bz2
expr.c (expand_java_field_op): Assigning to a final field outside an initializer does not violate JVM spec...
* expr.c (expand_java_field_op): Assigning to a final field outside an initializer does not violate JVM spec, so should be warning, not error. (Sun's verifier does not complain - though MicroSoft's does.) From-SVN: r39013
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/expr.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 7151645..0907e73 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2001-01-13 Per Bothner <per@bothner.com>
+
+ * expr.c (expand_java_field_op): Assigning to a final field outside
+ an initializer does not violate JVM spec, so should be warning, not
+ error. (Sun's verifier does not complain - though MicroSoft's does.)
+
2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk>
* gjavah.c (version), jcf-dump.c (version): Update copyright year
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 4ad903e..ddfc473 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -2215,7 +2215,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
else if (FIELD_STATIC (field_decl))
{
if (!DECL_CLINIT_P (current_function_decl))
- error_with_decl (field_decl,
+ warning_with_decl (field_decl,
"assignment to final static field `%s' not in class initializer");
}
else
@@ -2223,7 +2223,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
tree cfndecl_name = DECL_NAME (current_function_decl);
if (! DECL_CONSTRUCTOR_P (current_function_decl)
&& !ID_FINIT_P (cfndecl_name))
- error_with_decl (field_decl, "assignment to final field `%s' not in constructor");
+ warning_with_decl (field_decl, "assignment to final field `%s' not in constructor");
}
}
expand_assignment (field_ref, new_value, 0, 0);