Polyspace: different custom rules for variables depending other factors

3 vues (au cours des 30 derniers jours)
Imanol
Imanol le 3 Juin 2025
Réponse apportée : Harsh le 6 Juin 2025
I have been looking about the customization options that Polyspace offers regarding adding new rules, and I have seen that there is a possibility to add custom rules to check; for example, all global variables start with a capital letter.
This feels a little too limited for the scope of my project and I was wondering if there is a possibility to add different custom rules for variables depending on other factors, for example a rule that checks that the variable name starts with an "i" if the type is "int" and another rule that checks that the variable name starts with "u" if the type is "unsigned".
Thanks a lot!

Réponse acceptée

Harsh
Harsh le 6 Juin 2025
I understand that you are looking to apply Polyspace custom naming rules based on variable type.
Currently, in the existing versions of Polyspace, it is not possible to detect a specified pattern only for a particular datatype, as you described. While some partial support exists (e.g., setting a pattern for all integer types), we cannot target a single, specific integer type.
This means that within our custom coding rules, we won't be able to differentiate between types like short and integer. For more details, please refer to the following:
I hope this helps, thanks!

Plus de réponses (0)

Produits


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by