diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 33882e53c..749560517 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -53,8 +53,8 @@ Directive::Directive(const std::string &_file, const int _linenr, const std::str { } -bool Preprocessor::missingIncludeFlag; -bool Preprocessor::missingSystemIncludeFlag; +std::atomic Preprocessor::missingIncludeFlag; +std::atomic Preprocessor::missingSystemIncludeFlag; char Preprocessor::macroChar = char(1); diff --git a/lib/preprocessor.h b/lib/preprocessor.h index 8b63a212c..e33dfe9d1 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -23,6 +23,7 @@ #include "config.h" +#include #include #include #include @@ -84,8 +85,8 @@ public: explicit Preprocessor(Settings& settings, ErrorLogger *errorLogger = nullptr); virtual ~Preprocessor(); - static bool missingIncludeFlag; - static bool missingSystemIncludeFlag; + static std::atomic missingIncludeFlag; + static std::atomic missingSystemIncludeFlag; void inlineSuppressions(const simplecpp::TokenList &tokens); diff --git a/lib/settings.cpp b/lib/settings.cpp index cb965ac2b..f291dd923 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -20,7 +20,7 @@ #include "valueflow.h" -bool Settings::mTerminated; +std::atomic Settings::mTerminated; const char Settings::SafeChecks::XmlRootName[] = "safe-checks"; const char Settings::SafeChecks::XmlClasses[] = "class-public"; diff --git a/lib/settings.h b/lib/settings.h index feedf3f68..a4f829b9a 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -30,6 +30,7 @@ #include "suppressions.h" #include "timer.h" +#include #include #include #include @@ -65,7 +66,7 @@ private: int mEnabled; /** @brief terminate checking */ - static bool mTerminated; + static std::atomic mTerminated; public: Settings();