mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Disable some deprecation diagnostics for GCC
Clang automatically disables deprecation warnings for types used within already-deprecated contexts, such as if you use a deprecated type inside of a method that's beeen marked as deprecated. GCC doesn't have this feature so it spews a lot more warnings. These functions are now wrapped in pragmas that disable the warnings for the usage.
This commit is contained in:
parent
137e416a03
commit
149e3b3c32
19 changed files with 275 additions and 135 deletions
|
@ -42,10 +42,13 @@ static constexpr const char* hook_names[int(::zeek::plugin::NUM_HOOKS) + 1] = {
|
|||
return hook_names[int(h)];
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
const char* plugin::hook_name(::plugin::HookType h)
|
||||
{
|
||||
return hook_name(static_cast<::zeek::plugin::HookType>(h));
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
BifItem::BifItem(const std::string& arg_id, Type arg_type)
|
||||
{
|
||||
|
@ -355,20 +358,23 @@ Plugin::hook_list Plugin::EnabledHooks() const
|
|||
return plugin_mgr->HooksEnabledForPlugin(this);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
void Plugin::EnableHook(::plugin::HookType hook, int priority)
|
||||
{
|
||||
plugin_mgr->EnableHook(static_cast<zeek::plugin::HookType>(hook), this, priority);
|
||||
}
|
||||
|
||||
void Plugin::EnableHook(::zeek::plugin::HookType hook, int priority)
|
||||
{
|
||||
plugin_mgr->EnableHook(hook, this, priority);
|
||||
}
|
||||
|
||||
void Plugin::DisableHook(::plugin::HookType hook)
|
||||
{
|
||||
plugin_mgr->DisableHook(static_cast<zeek::plugin::HookType>(hook), this);
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void Plugin::EnableHook(::zeek::plugin::HookType hook, int priority)
|
||||
{
|
||||
plugin_mgr->EnableHook(hook, this, priority);
|
||||
}
|
||||
|
||||
void Plugin::DisableHook(::zeek::plugin::HookType hook)
|
||||
{
|
||||
|
@ -461,6 +467,8 @@ bool Plugin::HookReporter(const std::string& prefix, const EventHandlerPtr event
|
|||
return true;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
void Plugin::MetaHookPre(::plugin::HookType hook, const HookArgumentList& args)
|
||||
{
|
||||
}
|
||||
|
@ -468,6 +476,7 @@ void Plugin::MetaHookPre(::plugin::HookType hook, const HookArgumentList& args)
|
|||
void Plugin::MetaHookPost(::plugin::HookType hook, const HookArgumentList& args, HookArgument result)
|
||||
{
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void Plugin::MetaHookPre(::zeek::plugin::HookType hook, const HookArgumentList& args)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue