aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-03-28 18:04:15 +0100
committerXavier Leroy <xavierleroy@users.noreply.github.com>2020-04-20 09:37:39 +0200
commit99c97f7267a803bf92011857f5edbc8597e6b8da (patch)
tree5ab992ceb21130b340aa0b7f0da24f9eb45f5142 /cparser
parent6554dd6f8e5b1faafbda33b853a3de08ffd0ff6e (diff)
downloadcompcert-kvx-99c97f7267a803bf92011857f5edbc8597e6b8da.tar.gz
compcert-kvx-99c97f7267a803bf92011857f5edbc8597e6b8da.zip
Added warning for packed composite with bitfields.
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Bitfields.ml2
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