diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2020-03-28 18:04:15 +0100 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2020-04-20 09:37:39 +0200 |
commit | 99c97f7267a803bf92011857f5edbc8597e6b8da (patch) | |
tree | 5ab992ceb21130b340aa0b7f0da24f9eb45f5142 /cparser/Bitfields.ml | |
parent | 6554dd6f8e5b1faafbda33b853a3de08ffd0ff6e (diff) | |
download | compcert-kvx-99c97f7267a803bf92011857f5edbc8597e6b8da.tar.gz compcert-kvx-99c97f7267a803bf92011857f5edbc8597e6b8da.zip |
Added warning for packed composite with bitfields.
Diffstat (limited to 'cparser/Bitfields.ml')
-rw-r--r-- | cparser/Bitfields.ml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cparser/Bitfields.ml b/cparser/Bitfields.ml index efb82b01..9ca40e70 100644 --- a/cparser/Bitfields.ml +++ b/cparser/Bitfields.ml @@ -193,6 +193,8 @@ let transf_composite env loc su id attr ml = if List.for_all (fun f -> f.fld_bitfield = None) ml then (attr, ml) else begin + if find_custom_attributes ["packed";"__packed__"] attr <> [] then + Diagnostics.error loc "bitfields in packed structs not allowed"; let ml' = match su with | Struct -> transf_struct_members env id 1 ml |