--- layout: fc_discuss_archives title: Message 6 from Frama-C-discuss on January 2020 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] [frama-clang] Error compiling convert.ml on OSX10.14 with LLVM8.0.1/ocaml 4.06.0



Hi list,
I am trying to compile frama-clang on a Mac to work with Frama-c 20.0.

I have installed llvm 8.01 from Homebrew, as frama-clang requires this.
Originally built frama-c and frama-clang with ocaml 4.05.0, but hit
https://bts.frama-c.com/view.php?id=2480 (syntax error in reorder_defs.ml)

Created an opam switch for 4.06.0 to recompile frama-clang under 4.06 as
the proposed workaround to bug 2480 above (with frama-c and ocamlp4
compiled for 4.06.0) and seeing a new problem:

Ocamlc       convert.cmi
Ocamlc       convert.cmo
File "convert.ml", line 105, characters 4-27:
Error: The constructor PROTO expects 4 argument(s),
       but is applied here to 3 argument(s)
make: *** [convert.cmo] Error 2

The offending code seems to be (highlighted red):

(* creates an array[dim] of d. Because Cabs follows closely the C
syntax, we have to take some precautions here. *)
let rec protect_array_type al dim d =
match d with
| JUSTBASE -> ARRAY(d,al,dim)
| PARENTYPE (al1,d',al2) ->
PARENTYPE(al1,protect_array_type al dim d', al2)
| ARRAY(d',al',dim') ->
(* array dim of array dim' of d' is d' foo[dim][dim'] *)
ARRAY(protect_array_type al dim d',al',dim')
| PTR (al',d') ->
(* array dim of ptr to d' is d' *foo[dim] *)
PTR(al',protect_array_type al dim d')
(* array dim of ptr to function returning d' is d' ( *foo[dim]()) *)
105> | PROTO(d',args,variadic) ->
PROTO(protect_array_type al dim d',args,variadic)

./configure generated the following:

checking for frama-c-gui... yes
checking for Makefile.config.in... yes
frama_clang... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for camlp4o... yes
checking for clang... clang
checking for clang++... clang++
checking for llvm-config... llvm-config
checking for /usr/local/Cellar/llvm at 8/8.0.1_1/include/clang... yes
checking LLVM version... 8.0.1: Good
configure: frama_clang: yes
configure: creating ./config.status
config.status: creating ./Makefile.config

Not obvious to me how to proceed further. Any suggestions from the list?

Many thanks
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20200114/0069df47/attachment.html>