mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +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
|
@ -171,12 +171,15 @@ public:
|
|||
return hooks[hook] != nullptr;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::plugin::HookType")]]
|
||||
bool HavePluginForHook(::plugin::HookType hook) const
|
||||
{
|
||||
// Inline to avoid the function call.
|
||||
return HavePluginForHook(static_cast<zeek::plugin::HookType>(hook));
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* Returns all the hooks, with their priorities, that are currently
|
||||
|
@ -195,8 +198,6 @@ public:
|
|||
*
|
||||
* prio: The priority to associate with the plugin for this hook.
|
||||
*/
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::plugin::HookType")]]
|
||||
void EnableHook(::plugin::HookType hook, Plugin* plugin, int prio);
|
||||
void EnableHook(::zeek::plugin::HookType hook, Plugin* plugin, int prio);
|
||||
|
||||
/**
|
||||
|
@ -206,9 +207,16 @@ public:
|
|||
*
|
||||
* plugin: The plugin that used to define the hook.
|
||||
*/
|
||||
void DisableHook(::zeek::plugin::HookType hook, Plugin* plugin);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::plugin::HookType")]]
|
||||
void EnableHook(::plugin::HookType hook, Plugin* plugin, int prio);
|
||||
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::plugin::HookType")]]
|
||||
void DisableHook(::plugin::HookType hook, Plugin* plugin);
|
||||
void DisableHook(::zeek::plugin::HookType hook, Plugin* plugin);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* Registers interest in an event by a plugin, even if there's no handler
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue