@@ -850,7 +850,7 @@ static simplecpp::TokenList createTokenList(const std::string& filename, std::ve
850850 return {filename, files, outputList};
851851}
852852
853- std::size_t CppCheck::calculateHash (const Preprocessor& preprocessor, const simplecpp::TokenList& tokens) const
853+ std::size_t CppCheck::calculateHash (const Preprocessor& preprocessor, const simplecpp::TokenList& tokens, const std::string& filePath ) const
854854{
855855 std::ostringstream toolinfo;
856856 toolinfo << (mSettings .cppcheckCfgProductName .empty () ? CPPCHECK_VERSION_STRING : mSettings .cppcheckCfgProductName );
@@ -867,7 +867,7 @@ std::size_t CppCheck::calculateHash(const Preprocessor& preprocessor, const simp
867867 }
868868 toolinfo << mSettings .premiumArgs ;
869869 // TODO: do we need to add more options?
870- mSuppressions .nomsg .dump (toolinfo);
870+ mSuppressions .nomsg .dump (toolinfo, filePath );
871871 return preprocessor.calculateHash (tokens, toolinfo.str ());
872872}
873873
@@ -1020,7 +1020,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
10201020
10211021 if (analyzerInformation) {
10221022 // Calculate hash so it can be compared with old hash / future hashes
1023- const std::size_t hash = calculateHash (preprocessor, tokens1);
1023+ const std::size_t hash = calculateHash (preprocessor, tokens1, file. spath () );
10241024 std::list<ErrorMessage> errors;
10251025 if (!analyzerInformation->analyzeFile (mSettings .buildDir , file.spath (), cfgname, fileIndex, hash, errors)) {
10261026 while (!errors.empty ()) {
0 commit comments