From 99c97f7267a803bf92011857f5edbc8597e6b8da Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Sat, 28 Mar 2020 18:04:15 +0100 Subject: Added warning for packed composite with bitfields. --- cparser/Bitfields.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cparser') 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 -- cgit