diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index fea3e2d0f9a..893f96fe9fe 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -663,7 +663,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string CheckUnusedFunctions checkUnusedFunctions(nullptr, nullptr, nullptr); try { - Preprocessor preprocessor(mSettings, this); + Preprocessor preprocessor(mSettings, mSettings.nomsg, this); std::set configurations; simplecpp::OutputList outputList; diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 25e1377c03b..369a2188b65 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -64,7 +64,7 @@ Directive::Directive(std::string _file, const int _linenr, const std::string &_s char Preprocessor::macroChar = char(1); -Preprocessor::Preprocessor(Settings& settings, ErrorLogger *errorLogger) : mSettings(settings), mErrorLogger(errorLogger) +Preprocessor::Preprocessor(const Settings& settings, Suppressions &suppressions, ErrorLogger *errorLogger) : mSettings(settings), mSuppressions(suppressions), mErrorLogger(errorLogger) {} Preprocessor::~Preprocessor() @@ -129,7 +129,7 @@ static bool parseInlineSuppressionCommentToken(const simplecpp::Token *tok, std: return true; } -static void addinlineSuppressions(const simplecpp::TokenList &tokens, Settings &mSettings, std::list &bad) +static void addinlineSuppressions(const simplecpp::TokenList &tokens, const Settings &settings, Suppressions &suppressions, std::list &bad) { for (const simplecpp::Token *tok = tokens.cfront(); tok; tok = tok->next) { if (!tok->comment) @@ -155,8 +155,8 @@ static void addinlineSuppressions(const simplecpp::TokenList &tokens, Settings & // Relative filename std::string relativeFilename(tok->location.file()); - if (mSettings.relativePaths) { - for (const std::string & basePath : mSettings.basePaths) { + if (settings.relativePaths) { + for (const std::string & basePath : settings.basePaths) { const std::string bp = basePath + "/"; if (relativeFilename.compare(0,bp.size(),bp)==0) { relativeFilename = relativeFilename.substr(bp.size()); @@ -179,7 +179,7 @@ static void addinlineSuppressions(const simplecpp::TokenList &tokens, Settings & suppr.fileName = relativeFilename; suppr.lineNumber = tok->location.line; suppr.thisAndNextLine = thisAndNextLine; - mSettings.nomsg.addSuppression(suppr); + suppressions.addSuppression(suppr); } } } @@ -189,10 +189,10 @@ void Preprocessor::inlineSuppressions(const simplecpp::TokenList &tokens) if (!mSettings.inlineSuppressions) return; std::list err; - ::addinlineSuppressions(tokens, mSettings, err); + ::addinlineSuppressions(tokens, mSettings, mSuppressions, err); for (std::map::const_iterator it = mTokenLists.cbegin(); it != mTokenLists.cend(); ++it) { if (it->second) - ::addinlineSuppressions(*it->second, mSettings, err); + ::addinlineSuppressions(*it->second, mSettings, mSuppressions, err); } for (const BadInlineSuppression &bad : err) { error(bad.location.file(), bad.location.line, bad.errmsg); @@ -842,7 +842,7 @@ void Preprocessor::missingInclude(const std::string &filename, unsigned int line errorMessage.errorId = errorId; errorMessage.setFileName(std::move(fname)); errorMessage.lineNumber = linenr; - if (mSettings.nomsg.isSuppressed(errorMessage)) + if (mSuppressions.isSuppressed(errorMessage)) return; if (mErrorLogger) { @@ -866,7 +866,8 @@ void Preprocessor::missingInclude(const std::string &filename, unsigned int line void Preprocessor::getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) { Settings settings2(*settings); - Preprocessor preprocessor(settings2, errorLogger); + Suppressions supressions2; + Preprocessor preprocessor(settings2, supressions2, errorLogger); preprocessor.missingInclude(emptyString, 1, emptyString, UserHeader); preprocessor.missingInclude(emptyString, 1, emptyString, SystemHeader); preprocessor.error(emptyString, 1, "#error message"); // #error .. diff --git a/lib/preprocessor.h b/lib/preprocessor.h index a78c3d77607..de2973ba162 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -35,6 +35,7 @@ class ErrorLogger; class Settings; +class Suppressions; /** * @brief A preprocessor directive @@ -83,7 +84,7 @@ class CPPCHECKLIB Preprocessor { /** character that is inserted in expanded macros */ static char macroChar; - explicit Preprocessor(Settings& settings, ErrorLogger *errorLogger = nullptr); + explicit Preprocessor(const Settings& settings, Suppressions &suppressions, ErrorLogger *errorLogger = nullptr); virtual ~Preprocessor(); void inlineSuppressions(const simplecpp::TokenList &tokens); @@ -187,7 +188,8 @@ class CPPCHECKLIB Preprocessor { void missingInclude(const std::string &filename, unsigned int linenr, const std::string &header, HeaderTypes headerType); void error(const std::string &filename, unsigned int linenr, const std::string &msg); - Settings& mSettings; + const Settings& mSettings; + Suppressions &mSuppressions; ErrorLogger *mErrorLogger; /** list of all directives met while preprocessing file */ diff --git a/test/testclass.cpp b/test/testclass.cpp index 7b8d9483506..6aacc4641a2 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -259,7 +259,7 @@ class TestClass : public TestFixture { Settings settings; settings.severity.enable(Severity::warning); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -365,7 +365,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -519,7 +519,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings1, nullptr); + Preprocessor preprocessor(settings1, settings1.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings1, this, &preprocessor); @@ -682,7 +682,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -1131,7 +1131,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -1607,7 +1607,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings1, nullptr); + Preprocessor preprocessor(settings1, settings1.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings1, this, &preprocessor); @@ -2571,7 +2571,7 @@ class TestClass : public TestFixture { settings0.certainty.setEnabled(Certainty::inconclusive, inconclusive); settings0.severity.enable(Severity::warning); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -2894,7 +2894,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -3527,7 +3527,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings1, nullptr); + Preprocessor preprocessor(settings1, settings1.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings1, this, &preprocessor); @@ -3567,7 +3567,7 @@ class TestClass : public TestFixture { s = &settings0; s->certainty.setEnabled(Certainty::inconclusive, inconclusive); - Preprocessor preprocessor(*s, nullptr); + Preprocessor preprocessor(*s, s->nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(s, this, &preprocessor); @@ -7167,7 +7167,7 @@ class TestClass : public TestFixture { // Check.. settings0.certainty.setEnabled(Certainty::inconclusive, true); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -7205,7 +7205,7 @@ class TestClass : public TestFixture { Settings settings; settings.severity.enable(Severity::performance); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -7419,7 +7419,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings0, this, &preprocessor); @@ -7537,7 +7537,7 @@ class TestClass : public TestFixture { settings.severity.enable(Severity::warning); settings.certainty.setEnabled(Certainty::inconclusive, inconclusive); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -7886,7 +7886,7 @@ class TestClass : public TestFixture { Settings settings; settings.severity.enable(Severity::style); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -8064,7 +8064,7 @@ class TestClass : public TestFixture { settings.safeChecks.classes = true; settings.severity.enable(Severity::warning); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); @@ -8087,7 +8087,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings1, nullptr); + Preprocessor preprocessor(settings1, settings1.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings1, this, &preprocessor); @@ -8286,7 +8286,7 @@ class TestClass : public TestFixture { // Clear the error log errout.str(""); - Preprocessor preprocessor(settings1, nullptr); + Preprocessor preprocessor(settings1, settings1.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings1, this, &preprocessor); diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 155ee357a97..bfe80b7e9a0 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -155,7 +155,7 @@ class TestCondition : public TestFixture { std::map filedata; simplecpp::preprocess(tokens2, tokens1, files, filedata, simplecpp::DUI()); - Preprocessor preprocessor(*settings, nullptr); + Preprocessor preprocessor(*settings, settings->nomsg, nullptr); preprocessor.setDirectives(tokens1); // Tokenizer.. diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index e1a74d672e1..192de033786 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -287,7 +287,7 @@ class TestGarbage : public TestFixture { std::string checkCodeInternal_(const std::string &code, const char* filename, const char* file, int line) { errout.str(""); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); diff --git a/test/testother.cpp b/test/testother.cpp index 31c6e6dd54b..445361494d6 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -306,7 +306,7 @@ class TestOther : public TestFixture { settings->certainty.setEnabled(Certainty::experimental, experimental); settings->verbose = verbose; - Preprocessor preprocessor(*settings, nullptr); + Preprocessor preprocessor(*settings, settings->nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(settings, this, &preprocessor); @@ -347,7 +347,7 @@ class TestOther : public TestFixture { std::map filedata; simplecpp::preprocess(tokens2, tokens1, files, filedata, simplecpp::DUI()); - Preprocessor preprocessor(*settings, nullptr); + Preprocessor preprocessor(*settings, settings->nomsg, nullptr); preprocessor.setDirectives(tokens1); // Tokenizer.. @@ -1548,7 +1548,7 @@ class TestOther : public TestFixture { settings.severity.enable(Severity::style); settings.standards.cpp = Standards::CPP03; // #5560 - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizerCpp(&settings, this, &preprocessor); @@ -1754,7 +1754,7 @@ class TestOther : public TestFixture { settings.certainty.setEnabled(Certainty::inconclusive, inconclusive); settings.platform.defaultSign = 's'; - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); // Tokenize.. Tokenizer tokenizer(&settings, this, &preprocessor); diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index b1a3071b583..d7c55bea61b 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -46,7 +46,7 @@ class TestPreprocessor : public TestFixture { public: TestPreprocessor() : TestFixture("TestPreprocessor") - , preprocessor0(settings0, this) { + , preprocessor0(settings0, settings0.nomsg, this) { settings0.severity.enable(Severity::information); } @@ -64,7 +64,7 @@ class TestPreprocessor : public TestFixture { if (errorLogger) { Settings settings; - Preprocessor p(settings, errorLogger); + Preprocessor p(settings, settings.nomsg, errorLogger); p.reportOutput(outputList, true); } @@ -296,7 +296,7 @@ class TestPreprocessor : public TestFixture { settings.userDefines = arg + 2; if (arg && std::strncmp(arg,"-U",2)==0) settings.userUndefs.insert(arg+2); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); std::vector files; std::istringstream istr(filedata); simplecpp::TokenList tokens(istr,files); @@ -362,7 +362,7 @@ class TestPreprocessor : public TestFixture { errout.str(""); Settings settings; settings.userDefines = "__cplusplus"; - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("#error hello world!\n"); preprocessor.getcode(code, "X", "test.c"); ASSERT_EQUALS("[test.c:1]: (error) #error hello world!\n", errout.str()); @@ -375,7 +375,7 @@ class TestPreprocessor : public TestFixture { errout.str(""); Settings settings; settings.userDefines = "TEST"; - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("#file \"ab.h\"\n#error hello world!\n#endfile"); preprocessor.getcode(code, "TEST", "test.c"); ASSERT_EQUALS("[ab.h:1]: (error) #error hello world!\n", errout.str()); @@ -386,7 +386,7 @@ class TestPreprocessor : public TestFixture { errout.str(""); Settings settings; settings.userDefines = "TEST"; - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("#file \"ab.h\"\n\n#endfile\n#error aaa"); preprocessor.getcode(code, "TEST", "test.c"); ASSERT_EQUALS("[test.c:2]: (error) #error aaa\n", errout.str()); @@ -398,7 +398,7 @@ class TestPreprocessor : public TestFixture { Settings settings; settings.userDefines = "FOO"; settings.force = true; // No message if --force is given - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("#error hello world!\n"); preprocessor.getcode(code, "X", "test.c"); ASSERT_EQUALS("", errout.str()); @@ -463,7 +463,7 @@ class TestPreprocessor : public TestFixture { void setPlatformInfo() { Settings settings; - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); // read code with simplecpp.. const char filedata[] = "#if sizeof(long) == 4\n" @@ -1950,7 +1950,7 @@ class TestPreprocessor : public TestFixture { settings.inlineSuppressions = true; settings.severity.clear(); settings.checks.enable(Checks::missingInclude); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("// cppcheck-suppress missingInclude\n" "#include \"missing.h\"\n" @@ -2306,7 +2306,7 @@ class TestPreprocessor : public TestFixture { errout.str(""); Settings settings; settings.userDefines = "foo"; - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string code("#error hello world!\n"); preprocessor.getcode(code, "X", "./././test.c"); ASSERT_EQUALS("[test.c:1]: (error) #error hello world!\n", errout.str()); @@ -2344,7 +2344,7 @@ class TestPreprocessor : public TestFixture { " \n"; std::ostringstream ostr; - Preprocessor preprocessor(settings0, this); + Preprocessor preprocessor(settings0, settings0.nomsg, this); preprocessor.getcode(filedata, "", "test.c"); preprocessor.dump(ostr); ASSERT_EQUALS(dumpdata, ostr.str()); @@ -2371,7 +2371,7 @@ class TestPreprocessor : public TestFixture { " \n"; std::ostringstream ostr; - Preprocessor preprocessor(settings0, this); + Preprocessor preprocessor(settings0, settings0.nomsg, this); preprocessor.getcode(filedata, "", "test.c"); preprocessor.dump(ostr); ASSERT_EQUALS(dumpdata, ostr.str()); @@ -2388,7 +2388,7 @@ class TestPreprocessor : public TestFixture { " \n"; std::ostringstream ostr; - Preprocessor preprocessor(settings0, this); + Preprocessor preprocessor(settings0, settings0.nomsg, this); preprocessor.getcode(filedata, "", "test.c"); preprocessor.dump(ostr); ASSERT_EQUALS(dumpdata, ostr.str()); @@ -2402,7 +2402,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", ""); @@ -2421,7 +2421,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); std::string code("#include \"header.h\""); errout.str(""); @@ -2438,7 +2438,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", "", "inc"); @@ -2458,7 +2458,7 @@ class TestPreprocessor : public TestFixture { settings.includePaths.emplace_back("inc"); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", "", "inc"); @@ -2478,7 +2478,7 @@ class TestPreprocessor : public TestFixture { settings.includePaths.emplace_back("inc"); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", "", Path::getCurrentPath()); @@ -2497,7 +2497,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string header = Path::join(Path::getCurrentPath(), "header.h"); @@ -2516,7 +2516,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", ""); @@ -2535,7 +2535,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); std::string code("#include "); errout.str(""); @@ -2554,7 +2554,7 @@ class TestPreprocessor : public TestFixture { setTemplateFormat("simple"); settings.includePaths.emplace_back("system"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", "", "system"); @@ -2574,7 +2574,7 @@ class TestPreprocessor : public TestFixture { settings.includePaths.emplace_back("inc"); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", "", Path::getCurrentPath()); @@ -2593,7 +2593,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); const std::string header = Path::join(Path::getCurrentPath(), "header.h"); @@ -2612,7 +2612,7 @@ class TestPreprocessor : public TestFixture { settings.checks.enable(Checks::missingInclude); settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", ""); ScopedFile header2("header2.h", ""); @@ -2638,7 +2638,7 @@ class TestPreprocessor : public TestFixture { settings.templateFormat = "simple"; // has no effect setTemplateFormat("simple"); - Preprocessor preprocessor(settings, this); + Preprocessor preprocessor(settings, settings.nomsg, this); ScopedFile header("header.h", ""); ScopedFile header2("header2.h", ""); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ee255ad166b..79e72f83a94 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -6584,7 +6584,7 @@ class TestTokenizer : public TestFixture { "int PTR4 q4_var RBR4 = 0;\n"; // Preprocess file.. - Preprocessor preprocessor(settings0); + Preprocessor preprocessor(settings0, settings0.nomsg); std::list configurations; std::string filedata; std::istringstream fin(raw_code); @@ -7330,7 +7330,7 @@ class TestTokenizer : public TestFixture { std::map filedata; simplecpp::preprocess(tokens2, tokens1, files, filedata, simplecpp::DUI()); - Preprocessor preprocessor(settings0, nullptr); + Preprocessor preprocessor(settings0, settings0.nomsg, nullptr); preprocessor.setDirectives(tokens1); // Tokenizer.. diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index f031321011c..e7d87f1bb46 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -252,7 +252,7 @@ class TestUnusedVar : public TestFixture { // Clear the error buffer.. errout.str(""); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); if (directives) preprocessor.setDirectives(*directives); @@ -277,7 +277,7 @@ class TestUnusedVar : public TestFixture { std::map filedata; simplecpp::preprocess(tokens2, tokens1, files, filedata, simplecpp::DUI()); - Preprocessor preprocessor(settings, nullptr); + Preprocessor preprocessor(settings, settings.nomsg, nullptr); preprocessor.setDirectives(tokens1); // Tokenizer..