summaryrefslogtreecommitdiff
path: root/cparser/Cprint.ml
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-05-12 09:41:09 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-05-12 09:41:09 +0000
commitfe8baff11737d3785ff51d20ace9ab31665cd295 (patch)
treeedbab0f933283d5ecf455a5f94150c4f09379c51 /cparser/Cprint.ml
parent239cbd2ebab8814b11d7ef43c35a17ce56a7ba0b (diff)
cparser: support for attributes over struct and union.
cparser: added experimental emulation of packed structs (PackedStruct.ml) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1650 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Cprint.ml')
-rw-r--r--cparser/Cprint.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/cparser/Cprint.ml b/cparser/Cprint.ml
index 3d023a8..5887e87 100644
--- a/cparser/Cprint.ml
+++ b/cparser/Cprint.ml
@@ -470,13 +470,15 @@ let globdecl pp g =
fprintf pp "%a@ @ " full_decl d
| Gfundef f ->
fundef pp f
- | Gcompositedecl(kind, id) ->
- fprintf pp "%s %a;@ @ "
+ | Gcompositedecl(kind, id, attrs) ->
+ fprintf pp "%s%a %a;@ @ "
(match kind with Struct -> "struct" | Union -> "union")
+ attributes attrs
ident id
- | Gcompositedef(kind, id, flds) ->
- fprintf pp "@[<v 2>%s %a {"
+ | Gcompositedef(kind, id, attrs, flds) ->
+ fprintf pp "@[<v 2>%s%a %a {"
(match kind with Struct -> "struct" | Union -> "union")
+ attributes attrs
ident id;
List.iter (fun fld -> fprintf pp "@ %a;" field fld) flds;
fprintf pp "@;<0 -2>};@]@ @ "