File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -651,6 +651,15 @@ std::string SuppressionList::Suppression::toString() const
651651
652652polyspace::Parser::Parser (const Settings &settings)
653653{
654+ const auto it = std::find_if (settings.addonInfos .cbegin (),
655+ settings.addonInfos .cend (),
656+ [] (const AddonInfo &info) { return info.name == " misra" ; });
657+
658+ if (it != settings.addonInfos .cend ()) {
659+ mFamilyMap [" MISRA-C3" ] = " misra-c2012-" ;
660+ mFamilyMap [" MISRA2012" ] = " misra-c2012-" ;
661+ }
662+
654663 const auto matchArg = [&](const std::string &arg) {
655664 const std::string args = settings.premiumArgs ;
656665 const std::string::size_type pos = args.find (arg);
@@ -664,11 +673,6 @@ polyspace::Parser::Parser(const Settings &settings)
664673 return pos == args.size () - arg.size () || args[pos + arg.size ()] == ' ' ;
665674 };
666675
667- if (settings.addons .count (" misra" ) != 0 ) {
668- mFamilyMap [" MISRA-C3" ] = " misra-c2012-" ;
669- mFamilyMap [" MISRA2012" ] = " misra-c2012-" ;
670- }
671-
672676 if (matchArg (" --misra-c-2012" )) {
673677 mFamilyMap [" MISRA-C3" ] = " premium-misra-c-2012-" ;
674678 mFamilyMap [" MISRA2012" ] = " premium-misra-c-2012-" ;
You can’t perform that action at this time.
0 commit comments