Frama-C Bug Tracking System - Frama-C
View Issue Details
0002304Frama-CPlug-in > E-ACSLpublic2017-05-29 13:462017-12-06 09:10
evdenis 
signoles 
normalmajoralways
closedfixed 
Frama-C 14-Silicon 
Frama-C 16-Sulfur 
0002304: E-ACSL: compilation fail: generated functions doesn't have static inline attributes
The absence of static inline attributes forces optional dependencies to be strict. This leads to undefined reference errors during compilation. Test (inline.c): extern int do_mmap(int *a); static inline int test_extern(int *a) // Static inline { return do_mmap(a); } int main(void) { return 0; } GCC Run: $ gcc ./inline.c # There is no error about do_mmap $ echo $? 0 Generated Code (inline_generated.c): ... /*@ assigns \result, *a; assigns \result \from *a; assigns *a \from *a; */ int __gen_e_acsl_do_mmap(int *a); ... __inline static int test_extern(int *a) { int tmp; /*@ behavior pre_do_mmap: assigns tmp, *a; assigns tmp \from *a; assigns *a \from *a; */ tmp = __gen_e_acsl_do_mmap(a); return tmp; } ... /*@ assigns \result, *a; assigns \result \from *a; assigns *a \from *a; */ int __gen_e_acsl_do_mmap(int *a) // <== ERROR { int __retres; __retres = do_mmap(a); return __retres; } GCC Run: $ gcc ./inline_generated.c /tmp/cczBUd0r.o: In function `__gen_e_acsl_do_mmap': inline_generated.c:(.text+0x24): undefined reference to `do_mmap' collect2: error: ld returned 1 exit status
frama-c -e-acsl-prepare -rte -rte-precond ./inline.c -then -e-acsl -then-last -print > inline_generated.c gcc inline_generated.c
Quickfix: diff --git a/dup_functions.ml b/dup_functions.ml index 5774115..3b25fde 100644 --- a/dup_functions.ml +++ b/dup_functions.ml @@ -197,6 +197,8 @@ let dup_global loc old_prj spec bhv kf vi new_vi = let name = vi.vname in Options.feedback ~dkey ~level:2 "entering in function %s" name; let fundec = dup_fundec loc spec bhv kf vi new_vi in + fundec.svar.vinline <- true; + fundec.svar.vstorage <- Static; let fct = Definition(fundec, loc) in let new_spec = fundec.sspec in let new_kf = { fundec = fct; spec = new_spec } in
No tags attached.
c inline.c (126) 2017-05-29 13:46
https://bts.frama-c.com/file_download.php?file_id=1181&type=bug
patch inline.patch (540) 2017-05-29 13:47
https://bts.frama-c.com/file_download.php?file_id=1182&type=bug
Issue History
2017-05-29 13:46evdenisNew Issue
2017-05-29 13:46evdenisStatusnew => assigned
2017-05-29 13:46evdenisAssigned To => signoles
2017-05-29 13:46evdenisFile Added: inline.c
2017-05-29 13:47evdenisFile Added: inline.patch
2017-05-29 14:33signolesAssigned Tosignoles => kvorobyov
2017-10-24 17:42signolesAssigned Tokvorobyov => signoles
2017-10-25 15:38signolesNote Added: 0006468
2017-10-25 15:38signolesStatusassigned => resolved
2017-10-25 15:38signolesFixed in Version => Frama-C 16-Sulfur
2017-10-25 15:38signolesResolutionopen => fixed
2017-12-06 09:10signolesStatusresolved => closed

Notes
(0006468)
signoles   
2017-10-25 15:38   
Thanks for having reported this issue. It is solved in the current dev version.