Why is there a violation on MISRA-C:2012 Rule 8.7 with Polyspace Bug Finder R2021a?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 5 Ott 2023
Risposto: MathWorks Support Team
il 12 Ott 2023
I am trying to run a project in Polyspace Bug Finder R2021a. However, MISRA-C:2012 Rule 8.7 is being raised as a violation. Here is a code example where this rule violation is being flagged:
// in file.h
void FlushDataCache(void);
// in file.c
void FlushDataCache(void)
{
instruction
}
In the code above, the function should have internal linkage but if I put the 'static' keyword in my code, I receive an internal/external conflict. Is this a false positive or a valid error?
Risposta accettata
MathWorks Support Team
il 5 Ott 2023
The MISRA-C:2012 8.7 violation on "FlushDataCache" is a true positive in Polyspace Bug Finder R2021a.
To work around this issue, please add the 'static' keyword as you have mentioned, and remove the external declaration in your code.
For further information on how to debug this particular rule violation, please refer to the following Polyspace Bug Finder R2021a documentation page:
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MISRA C:2023 Directives and Rules in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!