aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-09-10 13:49:30 +0000
committerRichard Stallman <rms@gnu.org>1993-09-10 13:49:30 +0000
commita357ac88c0d5b040ea0f2c97dc0c1128536bde50 (patch)
tree991f23bd41f76c7beba47fc6ed2421bbb0b19f20 /gcc
parent5be957a209380ad64a46aee827377db39b2e28d6 (diff)
downloadgcc-a357ac88c0d5b040ea0f2c97dc0c1128536bde50.zip
gcc-a357ac88c0d5b040ea0f2c97dc0c1128536bde50.tar.gz
gcc-a357ac88c0d5b040ea0f2c97dc0c1128536bde50.tar.bz2
(check_init_type_bitfields): Check for mismatch
between field's mode and its type's mode. From-SVN: r5304
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 003c302..b833bcd 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -5485,7 +5485,9 @@ check_init_type_bitfields (type)
tree tail;
for (tail = TYPE_FIELDS (type); tail;
tail = TREE_CHAIN (tail))
- if (DECL_BIT_FIELD (tail))
+ if (DECL_BIT_FIELD (tail)
+ /* This catches cases like `int foo : 8;'. */
+ || DECL_MODE (tail) != TYPE_MODE (TREE_TYPE (tail)))
{
constructor_incremental = 0;
break;