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,19 @@ std::string SuppressionList::Suppression::toString() const
651651
652652polyspace::Parser::Parser (const Settings &settings)
653653{
654+ const auto it = std::find_if (
655+ settings.addonInfos .cbegin (),
656+ settings.addonInfos .cend (),
657+ [] (const AddonInfo &info) {
658+ return info.name == " misra" ;
659+ }
660+ );
661+
662+ if (it != settings.addonInfos .cend ()) {
663+ mFamilyMap [" MISRA-C3" ] = " misra-c2012-" ;
664+ mFamilyMap [" MISRA2012" ] = " misra-c2012-" ;
665+ }
666+
654667 const auto matchArg = [&](const std::string &arg) {
655668 const std::string args = settings.premiumArgs ;
656669 const std::string::size_type pos = args.find (arg);
@@ -664,11 +677,6 @@ polyspace::Parser::Parser(const Settings &settings)
664677 return pos == args.size () - arg.size () || args[pos + arg.size ()] == ' ' ;
665678 };
666679
667- if (settings.addons .count (" misra" ) != 0 ) {
668- mFamilyMap [" MISRA-C3" ] = " misra-c2012-" ;
669- mFamilyMap [" MISRA2012" ] = " misra-c2012-" ;
670- }
671-
672680 if (matchArg (" --misra-c-2012" )) {
673681 mFamilyMap [" MISRA-C3" ] = " premium-misra-c-2012-" ;
674682 mFamilyMap [" MISRA2012" ] = " premium-misra-c-2012-" ;
You can’t perform that action at this time.
0 commit comments