0

I am trying to generate an annotated file with Frama-C E-ACSL plugin. I created the following files:

  • Insert.c: contains all the structures to create a linked list.
  • AxiomTest.c: includes the main function where the asserts it must fulfil are indicated. All functions and structures are determined in terms of Insert.c file

When compiling/instrumenting a program the manual specifies the following terminal command:

$ e-acsl-gcc.sh -c <files> -O <output>

For a successful compilation Insert.c and AxiomTest.c must be linked but I cannot find any flag for that.

Any help? Or is there any other way to do it right?

  • Did you try `e-acsl-gcc.sh -c Insert.c AxiomTest.c -O my_executable`? Normally the script should accept many source files as argument (hence `` and not `` in the manual). – Virgile Apr 26 '18 at 14:26
  • Doing `e-acsl-gcc.sh -c Insert.c AxiomTest.c -O my_executable` links both files, but I still get an error that says: _unbound function foo_. This function _foo_ is defined in the **Intert.c** file, and it is called in **AxiomTest.c** inside a `@ requires` clause from the EACSL annotations. Could be that EACSL does not accept a function in the annotation and generates an error? – Raul Coroban Apr 27 '18 at 21:14
  • 1
    you can't call C functions (although you can refer to them as function pointer, e.g. `my_fct_ptr == f1 || my_fct_ptr == f2`) inside an ACSL annotationsindeed: only logic functions and predicates are allowed there. And of course, if errors happen before the link stage, no executable will be produced. If you have specific issues with the errors reported by Frama-C/E-ACSL, please create a new question, and be sure to include a [MCVE](https://stackoverflow.com/help/mcve) showing us the exact problem you're facing. – Virgile Apr 28 '18 at 07:22

1 Answers1

0

e-acsl-gcc.sh does compile and link files with option -c, despite looking like it only compiles (the -c here is unrelated to GCC's -c option, which does only compilation, without linking).

If you want to give extra flags to the linker, man e-acsl-gcc.sh (or e-acsl-gcc.sh -h) will indicate option -l:

-l         pass additional options to the linker
anol
  • 8,264
  • 3
  • 34
  • 78