aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/PackedStructs.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-01-01 11:08:12 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-01-01 11:08:12 +0100
commit442e3140f4a2172bbc1ee7ce260eb1a8fd79ae95 (patch)
tree9dc3613e16330410d361b43cc4f68b1a042c2012 /cparser/PackedStructs.ml
parent1379deed055fc6b1462915a0177e75f4f9a127eb (diff)
downloadcompcert-kvx-442e3140f4a2172bbc1ee7ce260eb1a8fd79ae95.tar.gz
compcert-kvx-442e3140f4a2172bbc1ee7ce260eb1a8fd79ae95.zip
Revised type compatibility check w.r.t. handling of attributes.
We now distinguish 3 modes (instead of 2 previously) for attributes: 1- strict compatibility, 2- ignore top-level attrs, 3- ignore all attrs recursively. In strict mode, const/volatile/restrict attributes must be identical, but nonstandard attributes may vary. Also: ignore top-level attrs when comparing function argument types, like GCC/Clang do. Net result is fewer warnings and type-checking that is closer to GCC/Clang.
Diffstat (limited to 'cparser/PackedStructs.ml')
-rw-r--r--cparser/PackedStructs.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/PackedStructs.ml b/cparser/PackedStructs.ml
index 3064e78d..686a7d39 100644
--- a/cparser/PackedStructs.ml
+++ b/cparser/PackedStructs.ml
@@ -147,7 +147,7 @@ let accessor_type loc env ty =
let ecast ty e = {edesc = ECast(ty, e); etyp = ty}
let ecast_opt env ty e =
- if compatible_types ~noattrs:true env ty e.etyp then e else ecast ty e
+ if compatible_types AttrCompat env ty e.etyp then e else ecast ty e
(* (ty) __builtin_readNN_reversed(&lval)
or (ty) __builtin_bswapNN(lval) *)