From 001222523a8d3ed758761916d85432b8dde2b2c2 Mon Sep 17 00:00:00 2001 From: xleroy Date: Fri, 21 Jun 2013 07:41:32 +0000 Subject: Recognize attribute((packed)) after a "struct {...}" and not just between "struct" and "{", for compatibility with GCC. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2285 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cparser/Cutil.ml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cparser/Cutil.ml') diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml index 212303a..2fc269c 100644 --- a/cparser/Cutil.ml +++ b/cparser/Cutil.ml @@ -141,6 +141,12 @@ let remove_attributes_type env attr t = let erase_attributes_type env t = change_attributes_type env (fun a -> []) t +(* Is an attribute type-related (true) or variable-related (false)? *) + +let attr_is_type_related = function + | Attr(("packed" | "__packed__"), _) -> true + | _ -> false + (* Type compatibility *) exception Incompat -- cgit v1.2.3