Named Constants in ACSL Specifications

How can I use named constants in ACSL specifications? These constants are either macros ( #define MY_CONST ...) or constant declarations ( const int MY_CONST ...). The former does not work, since macros are not extended by the preprocessor (ACSL specifications are C comments), the latter is not because constants are treated as variables, so some evidence fails. The specification works fine if I replace named constants with actual numbers.

Does anyone have a good idea for handling named constants? thanks in advance

+4
source share
2 answers

ACSL, -pp-annot.

+6

. frama-c, gcc. -fpreprocessed . :

frama-c -cpp-extra-args="-I `frama-c -print-share-path`/libc" -cpp-extra-args="-nostdinc" -cpp-extra-args="-fpreprocessed </path/to/stdc-predef.h>" -wp -wp-rte -pp-annot myfile.c
+1

Source: https://habr.com/ru/post/1532037/


All Articles