aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend/PrintCsyntax.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cfrontend/PrintCsyntax.ml')
-rw-r--r--cfrontend/PrintCsyntax.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/cfrontend/PrintCsyntax.ml b/cfrontend/PrintCsyntax.ml
index 88e24eed..fa1d0482 100644
--- a/cfrontend/PrintCsyntax.ml
+++ b/cfrontend/PrintCsyntax.ml
@@ -378,6 +378,11 @@ let print_init p = function
| Init_float32 n -> fprintf p "%F,@ " n
| Init_float64 n -> fprintf p "%F,@ " n
| Init_space n -> fprintf p "/* skip %ld, */@ " (camlint_of_coqint n)
+ | Init_addrof(symb, ofs) ->
+ let ofs = camlint_of_coqint ofs in
+ if ofs = 0l
+ then fprintf p "&%s,@ " (extern_atom symb)
+ else fprintf p "(void *)((char *)&%s + %ld),@ " (extern_atom symb) ofs
| Init_pointer id ->
match string_of_init id with
| None -> fprintf p "/* pointer to other init*/,@ "