Polyspace-bug-finder raises issue due to Rule A3-1-5 if inline function is declared in source file
Afficher commentaires plus anciens
Hello,
I declared a function in the header file and implemented it in the source file using the "inline" keyword. Polyspace-bug-finder still raises an issue because of Autosar rule A3-1-5.
Is this intended so that the function definition shall be placed in the header file?
Thanks!
Réponse acceptée
Plus de réponses (1)
Viktoria
le 28 Juil 2023
2 commentaires
Anirban
le 7 Août 2023
Thanks for the reproduction! Yes, the checker is intended to work this way. The specs for AUTOSAR C++14 A3-1-5 suggest placing the definitions of small methods inside the class definition to save time and space (and the checker treats one-line functions as "small methods"). So, in the above example, placing the method definition inside the class definition would be the fix for the coding rule violation.
Viktoria
le 8 Août 2023
Catégories
En savoir plus sur AUTOSAR C++14 Rules dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!