Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Support LLVM database "compile_commands.json"

  • Subject: [Frama-c-discuss] Support LLVM database "compile_commands.json"
  • From: virgile.prevosto at (Virgile Prevosto)
  • Date: Tue, 16 May 2017 12:50:31 +0200
  • In-reply-to: <>
  • References: <>


2017-05-05 17:39 GMT+02:00 Matt <mattator at>:
> Hi,
> I am fairly new to frama-c. I followed the great tutorial on the eva
> plugin and I am now trying to run frama-c on the neovim project
> ( to get some
> metrics such as cyclomatic complexity.

Syntactic metrics are not exactly the main target of Frama-C. Are you
planning to use EVA (which looks like a major endeavor on neovim)
afterwards? Otherwise, I'm not completely sure this is worth the

> I wonder if it's possible to pass several -cpp-command depending on
> the file  "-cpp-command file1.c -cpp-command file2.c etc" to match the
> flags in the compilation database (made popular with clang, can be
> generated by cmake/bear and is used in tools such as
> chromatica.nvim/YouCompleteMe etc):

No. support for pre-processing in Frama-C is quite basic. That said,
it is possible to do something like
frama-c -ocode file1.i -cpp-command cmd1 -print file1.c -then -ocode
file2.i -cpp-command cmd2 -print file2.c [...] -then -ocode="" file1.i
file2.i [analysis options]

or of course
frama-c -ocode file1.i -cpp-command cmd1 -print file1.c
frama-c -ocode file2.i -cpp-command cmd2 -print file2.c
frama-c file1.i file2.i ...

As an aside, unless you really want to change the whole pre-processor,
it's usually better to use -cpp-extra-args="-Iinclude-lib -DFOO ..."
rather than -cpp-command.

Best regards,
E tutto per oggi, a la prossima volta