Commit 3b24f55b by Richard Stallman

(check_for_full_enumeration_handling): Handle nameless type.

From-SVN: r3516
parent b4e3b9e9
...@@ -3602,12 +3602,18 @@ check_for_full_enumeration_handling (type) ...@@ -3602,12 +3602,18 @@ check_for_full_enumeration_handling (type)
; ;
if (!chain) if (!chain)
warning ("case value `%d' not in enumerated type `%s'", {
TREE_INT_CST_LOW (n->low), if (TYPE_NAME (type) == 0)
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type)) warning ("case value `%d' not in enumerated type",
== IDENTIFIER_NODE) TREE_INT_CST_LOW (n->low));
? TYPE_NAME (type) else
: DECL_NAME (TYPE_NAME (type)))); 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)) if (!tree_int_cst_equal (n->low, n->high))
{ {
for (chain = TYPE_VALUES (type); for (chain = TYPE_VALUES (type);
...@@ -3616,12 +3622,18 @@ check_for_full_enumeration_handling (type) ...@@ -3616,12 +3622,18 @@ check_for_full_enumeration_handling (type)
; ;
if (!chain) if (!chain)
warning ("case value `%d' not in enumerated type `%s'", {
TREE_INT_CST_LOW (n->high), if (TYPE_NAME (type) == 0)
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type)) warning ("case value `%d' not in enumerated type",
== IDENTIFIER_NODE) TREE_INT_CST_LOW (n->high));
? TYPE_NAME (type) else
: DECL_NAME (TYPE_NAME (type)))); 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))));
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment