aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parse.y
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-05-05 17:18:02 -0600
committerJeff Law <law@gcc.gnu.org>1998-05-05 17:18:02 -0600
commitf5963e617044e79f7658c82ebc9acdccdc56d57b (patch)
tree017db6c8be411c52ab98093e94dcce3c7ca3f029 /gcc/c-parse.y
parent9d1bcb4667cf94ae02b3b3015694a55175be9c9f (diff)
downloadgcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.zip
gcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.tar.gz
gcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.tar.bz2
* Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
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 aba326d..4f0b1af 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)