summaryrefslogtreecommitdiff
path: root/gcc/c-parse.y
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-05 23:18:02 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-05 23:18:02 +0000
commitc5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80 (patch)
tree017db6c8be411c52ab98093e94dcce3c7ca3f029 /gcc/c-parse.y
parent870d7a364fabca1efd21f7b8a996934ab7f91805 (diff)
downloadgcc-c5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80.tar.gz
* Check in merge from gcc2. See ChangeLog.12 for details.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.y')
-rw-r--r--gcc/c-parse.y10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c-parse.y b/gcc/c-parse.y
index aba326d02b9..4f0b1afe97c 100644
--- a/gcc/c-parse.y
+++ b/gcc/c-parse.y
@@ -1910,8 +1910,14 @@ label: CASE expr_no_commas ':'
if (value != error_mark_node)
{
tree duplicate;
- int success = pushcase (value, convert_and_check,
- label, &duplicate);
+ int success;
+
+ if (pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value)))
+ pedwarn ("label must have integral type in ANSI C");
+
+ success = pushcase (value, convert_and_check,
+ label, &duplicate);
+
if (success == 1)
error ("case label not within a switch statement");
else if (success == 2)