diff --git a/External/CheckerGccPlugins/src/callcheck_plugin.cxx b/External/CheckerGccPlugins/src/callcheck_plugin.cxx index dc85352f0d3b81f0db4e569e8d40b2a2b2829d03..e2df3fc7c056aebc23d97a4da588f5e3a9f704c6 100644 --- a/External/CheckerGccPlugins/src/callcheck_plugin.cxx +++ b/External/CheckerGccPlugins/src/callcheck_plugin.cxx @@ -323,7 +323,7 @@ unsigned int callcheck_pass::callcheck_execute (function* fun) // ROOT special case. // The ClassDef macro injects this into user classes; the inline // definition of this uses static data. - if (strcmp (namestr, "CheckTObjectHashConsistency") == 0) { + if (namestr && strcmp (namestr, "CheckTObjectHashConsistency") == 0) { return 0; } } diff --git a/External/CheckerGccPlugins/src/thread_plugin.cxx b/External/CheckerGccPlugins/src/thread_plugin.cxx index cfdb70aa603a86c9b2738d0def9213b6d4176c2e..2eb499c361765d08148ed56fecafac790c5ee229 100644 --- a/External/CheckerGccPlugins/src/thread_plugin.cxx +++ b/External/CheckerGccPlugins/src/thread_plugin.cxx @@ -293,7 +293,10 @@ void check_attrib_consistency (Attributes_t attribs, tree decl) bool has_thread_safe_attrib (tree decl) { - return lookup_attribute ("thread_safe", DECL_ATTRIBUTES (decl)); + if (lookup_attribute ("thread_safe", DECL_ATTRIBUTES (decl))) { + return true; + } + return lookup_attribute ("thread_safe", TYPE_ATTRIBUTES (TREE_TYPE (decl))); } @@ -1875,16 +1878,18 @@ void check_calls (Attributes_t attribs, gimplePtr stmt, function* fun) if (name) { const char* namestr = IDENTIFIER_POINTER (name); - // Skip names starting with __. Exception: constructors and destructors - // will have names like __ct_ and __dt_; don't skip those. - if (namestr && namestr[0] == '_' && namestr[1] == '_' && - !startswith (namestr, "__ct_") && - !startswith (namestr, "__dt_")) - { - return; + if (namestr) { + // Skip names starting with __. Exception: constructors and destructors + // will have names like __ct_ and __dt_; don't skip those. + if (namestr[0] == '_' && namestr[1] == '_' && + !startswith (namestr, "__ct_") && + !startswith (namestr, "__dt_")) + { + return; + } + if (strcmp (namestr, "operator delete") == 0) return; + if (strcmp (namestr, "operator delete []") == 0) return; } - if (strcmp (namestr, "operator delete") == 0) return; - if (strcmp (namestr, "operator delete []") == 0) return; } Attributes_t fnattribs = get_attributes (fndecl); @@ -1991,7 +1996,7 @@ unsigned int thread_pass::thread_execute (function* fun) // ROOT special case. // The ClassDef macro injects this into user classes; the inline // definition of this uses static data. - if (strcmp (namestr, "CheckTObjectHashConsistency") == 0) { + if (namestr && strcmp (namestr, "CheckTObjectHashConsistency") == 0) { return 0; } } diff --git a/External/CheckerGccPlugins/test/thread7_test.cxx b/External/CheckerGccPlugins/test/thread7_test.cxx index 4c9ee00109df2e5a47e927aacb5fd47008ac277e..d86a492ae825c15b83479edd7bb5789ec2a5a608 100644 --- a/External/CheckerGccPlugins/test/thread7_test.cxx +++ b/External/CheckerGccPlugins/test/thread7_test.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // testing check for static/mutable members #pragma ATLAS check_thread_safety @@ -58,3 +58,12 @@ struct GaudiTest mutable Gaudi::Accumulators::Counter<int, Gaudi::Accumulators::atomicity::full> x2; mutable Gaudi::Accumulators::Counter<int, Gaudi::Accumulators::atomicity::none> x3; }; + + +class TileROD_Decoder +{ +public: + virtual ~TileROD_Decoder(); + mutable int m_OFWeights[1000] [[ATLAS::thread_safe]]; + +};