Is there a possibility to make replacements in preprocessor directives in Polyspace Code Prover R2019b?
Show older comments
I have a question concerning Macro definitions:
Is it possible to overwrite a special value which is defined by macro in order to have another verification behavior?
In the example below I want to manipulate CONSTANT_A and set it to 0 although it is set to 2 in the code. My goal is to force the verification to analyze also the else-path without touching the code.
#include <stdio.h>
#define CONSTANT_A (2)
#if (CONSTANT_A != 0)
#define MY_MACRO(_var) {_var = 0;}
#else
#define MY_MACRO(_var) {_var = 1;}
#endif
int main(void)
{
int a = 10;
int b = 20;
int res = a + b;
MY_MACRO(res);
return 0;
}
Is there a possibility?
Accepted Answer
More Answers (0)
Categories
Find more on Configure Sources and Build Options in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!