This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Java: Fix PR 8618
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Andreas Tobler <toa at pop dot agri dot ch>
- Cc: java-patches at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Sat, 10 Jul 2004 11:53:39 -0400
- Subject: Re: Patch: Java: Fix PR 8618
- References: <40EF67C7.3030504@redhat.com> <40EF9A87.1030509@pop.agri.ch>
On Jul 10, 2004, at 3:28 AM, Andreas Tobler wrote:
int
common_enclosing_context_p (tree type1, tree type2)
{
+ for (type1; type1; <----------- here + type1 =
(INNER_CLASS_TYPE_P (type1) ?
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))) : NULL_TREE))
+ {
+ tree current;
+ for (current = type2; current;
+ current = (INNER_CLASS_TYPE_P (current) ?
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current))) : +
NULL_TREE))
+ if (type1 == current)
+ return 1;
+ }
+ return 0;
+}
I get a warning with 'statement with no effect on class.c:597'
I'm checking in this patch to fix it (obvious rule).
Regards
Bryce
2004-07-10 Bryce McKinlay <mckinlay@redhat.com>
* class.c (common_enclosing_context_p): Remove statement with no
side-effects.
--- class.c 10 Jul 2004 05:38:15 -0000 1.197
+++ class.c 10 Jul 2004 15:50:02 -0000
@@ -594,9 +594,7 @@
int
common_enclosing_context_p (tree type1, tree type2)
{
- for (type1; type1;
- type1 = (INNER_CLASS_TYPE_P (type1) ?
- TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))) :
NULL_TREE))
+ while (type1)
{
tree current;
for (current = type2; current;
@@ -605,6 +603,11 @@
NULL_TREE))
if (type1 == current)
return 1;
+
+ if (INNER_CLASS_TYPE_P (type1))
+ type1 = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1)));
+ else
+ break;
}
return 0;
}