diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-17 17:27:35 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-17 17:27:35 +0100 |
commit | 5a2b261e9efdfb0d9fbc51cec8c1f5405679f2a0 (patch) | |
tree | da1598d438cc1f0b3c41ad5bac10168d026cfb5d | |
parent | 5b9ce1dd0e0f22bd138ac7d43d25abf2f2011c7a (diff) | |
download | compcert-5a2b261e9efdfb0d9fbc51cec8c1f5405679f2a0.tar.gz compcert-5a2b261e9efdfb0d9fbc51cec8c1f5405679f2a0.zip |
Enum is compatible to its integer type.
The C standard specifies that an enum type should be compatible
to some integer type (ISO/IEC 9899:TC3 ยง6.7.2.2p4).
Fix 16692
-rw-r--r-- | cparser/Cutil.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml index 1b0bf65d..1109cf79 100644 --- a/cparser/Cutil.ml +++ b/cparser/Cutil.ml @@ -310,6 +310,9 @@ let combine_types mode env t1 t2 = TUnion(comp_base s1 s2, comp_attr m a1 a2) | TEnum(s1, a1), TEnum(s2, a2) -> TEnum(comp_base s1 s2, comp_attr m a1 a2) + | TEnum(s,a1), TInt(enum_ikind,a2) + | TInt(enum_ikind,a2), TEnum (s,a1) -> + TEnum(s,comp_attr m a1 a2) | _, _ -> raise Incompat |