mirror of
https://github.com/Icinga/icinga2.git
synced 2026-05-28 04:12:13 -04:00
Silence -Wdangling-reference warning in ApplyRule
This is a false-positive because the functions in question return a reference to memory in a static variable that remains fixed after program start. This commit adds a macro for the `[[gnu::no_dangling]]` attribute to ignore the warning for the tagged functions and uses that macro on both functions returning references to the static variable.
This commit is contained in:
parent
30fc4e2160
commit
afe17f10c1
1 changed files with 2 additions and 2 deletions
|
|
@ -81,8 +81,8 @@ public:
|
|||
const Expression::Ptr& filter, const String& package, const String& fkvar, const String& fvvar, const Expression::Ptr& fterm,
|
||||
bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope);
|
||||
static const std::vector<ApplyRule::Ptr>& GetRules(const Type::Ptr& sourceType, const Type::Ptr& targetType);
|
||||
static const std::set<ApplyRule::Ptr>& GetTargetedHostRules(const Type::Ptr& sourceType, const String& host);
|
||||
static const std::set<ApplyRule::Ptr>& GetTargetedServiceRules(const Type::Ptr& sourceType, const String& host, const String& service);
|
||||
[[gnu::no_dangling]] static const std::set<ApplyRule::Ptr>& GetTargetedHostRules(const Type::Ptr& sourceType, const String& host);
|
||||
[[gnu::no_dangling]] static const std::set<ApplyRule::Ptr>& GetTargetedServiceRules(const Type::Ptr& sourceType, const String& host, const String& service);
|
||||
static bool GetTargetHosts(Expression* assignFilter, std::vector<const String *>& hosts, const Dictionary::Ptr& constants = nullptr);
|
||||
static bool GetTargetServices(Expression* assignFilter, std::vector<std::pair<const String *, const String *>>& services, const Dictionary::Ptr& constants = nullptr);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue