aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-02-23 23:01:38 +0000
committerRichard Stallman <rms@gnu.org>1993-02-23 23:01:38 +0000
commit3b24f55b09240dcc38e3df08e57b3fcd42f602c4 (patch)
treea0c580064df31692d4b13efffb2030ed682f0007
parentb4e3b9e995973c26a42fad75d3c60569d37f6d6a (diff)
downloadgcc-3b24f55b09240dcc38e3df08e57b3fcd42f602c4.zip
gcc-3b24f55b09240dcc38e3df08e57b3fcd42f602c4.tar.gz
gcc-3b24f55b09240dcc38e3df08e57b3fcd42f602c4.tar.bz2
(check_for_full_enumeration_handling): Handle nameless type.
From-SVN: r3516
-rw-r--r--gcc/stmt.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index a615fce..5c16f50 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3602,12 +3602,18 @@ check_for_full_enumeration_handling (type)
;
if (!chain)
- warning ("case value `%d' not in enumerated type `%s'",
- TREE_INT_CST_LOW (n->low),
- IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
- == IDENTIFIER_NODE)
- ? TYPE_NAME (type)
- : DECL_NAME (TYPE_NAME (type))));
+ {
+ if (TYPE_NAME (type) == 0)
+ warning ("case value `%d' not in enumerated type",
+ TREE_INT_CST_LOW (n->low));
+ else
+ warning ("case value `%d' not in enumerated type `%s'",
+ TREE_INT_CST_LOW (n->low),
+ IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
+ == IDENTIFIER_NODE)
+ ? TYPE_NAME (type)
+ : DECL_NAME (TYPE_NAME (type))));
+ }
if (!tree_int_cst_equal (n->low, n->high))
{
for (chain = TYPE_VALUES (type);
@@ -3616,12 +3622,18 @@ check_for_full_enumeration_handling (type)
;
if (!chain)
- warning ("case value `%d' not in enumerated type `%s'",
- TREE_INT_CST_LOW (n->high),
- IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
- == IDENTIFIER_NODE)
- ? TYPE_NAME (type)
- : DECL_NAME (TYPE_NAME (type))));
+ {
+ if (TYPE_NAME (type) == 0)
+ warning ("case value `%d' not in enumerated type",
+ TREE_INT_CST_LOW (n->high));
+ else
+ warning ("case value `%d' not in enumerated type `%s'",
+ TREE_INT_CST_LOW (n->high),
+ IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
+ == IDENTIFIER_NODE)
+ ? TYPE_NAME (type)
+ : DECL_NAME (TYPE_NAME (type))));
+ }
}
}