From f5fac966707628953d75269d35327a6a81a81304 Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Fri, 16 Jul 2021 11:47:35 -0500 Subject: [PATCH] Add include directives to 'define' tokenlist (#3337) --- lib/cppcheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 976fa4e57..3eef69468 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -704,7 +704,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string std::string code; const std::list &directives = preprocessor.getDirectives(); for (const Directive &dir : directives) { - if (dir.str.compare(0,8,"#define ") == 0) + if (dir.str.compare(0,8,"#define ") == 0 || dir.str.compare(0,9,"#include ") == 0) code += "#line " + MathLib::toString(dir.linenr) + " \"" + dir.file + "\"\n" + dir.str + '\n'; } Tokenizer tokenizer2(&mSettings, this);