@@ -334,15 +334,22 @@ bool SuppressionList::Suppression::parseComment(std::string comment, std::string
334334 if (comment.size () < 2 )
335335 return false ;
336336
337- if (comment.find (' ;' ) != std::string::npos)
338- comment.erase (comment.find (' ;' ));
339-
340- if (comment.find (" //" , 2 ) != std::string::npos)
341- comment.erase (comment.find (" //" ,2 ));
342-
343337 if (comment.compare (comment.size () - 2 , 2 , " */" ) == 0 )
344338 comment.erase (comment.size () - 2 , 2 );
345339
340+ std::string::size_type extraPos = comment.find (' ;' );
341+ std::string::size_type extraDelimiterSize = 1 ;
342+
343+ if (extraPos == std::string::npos) {
344+ extraPos = comment.find (" //" , 2 );
345+ extraDelimiterSize = 2 ;
346+ }
347+
348+ if (extraPos != std::string::npos) {
349+ extraComment = trim (comment.substr (extraPos + extraDelimiterSize));
350+ comment.erase (extraPos);
351+ }
352+
346353 const std::set<std::string> cppchecksuppress{
347354 " cppcheck-suppress" ,
348355 " cppcheck-suppress-begin" ,
@@ -532,6 +539,12 @@ void SuppressionList::dump(std::ostream & out) const
532539 out << " type=\" blockEnd\" " ;
533540 else if (suppression.type == SuppressionList::Type::macro)
534541 out << " type=\" macro\" " ;
542+ if (suppression.isInline )
543+ out << " inline=\" true\" " ;
544+ else
545+ out << " inline=\" false\" " ;
546+ if (!suppression.extraComment .empty ())
547+ out << " comment=\" " << suppression.extraComment << " \" " ;
535548 out << " />" << std::endl;
536549 }
537550 out << " </suppressions>" << std::endl;
0 commit comments