EventRegistry: Deprecate UsedHandlers() and UnusedHandlers()

and check_for_unused_event_handlers: UsageAnalyzer is more thorough
and the previous ones weren't extended to work with &is_used and
should probably be considered superseded by the UsageAnalyzer even
if that currently does not provide a public API and just prints
out deprecation warnings.

I'm also tempted to deprecate SetUsed() and Used() of EventHandler
for the same reason.

Closes #3187.
This commit is contained in:
Arne Welzel 2023-11-02 18:02:22 +01:00
parent cd24acdfc8
commit 398122206e
5 changed files with 8 additions and 4 deletions

View file

@ -1008,7 +1008,10 @@ SetupResult setup(int argc, char** argv, Options* zopts) {
if ( zeek_init )
event_mgr.Enqueue(zeek_init, Args{});
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
EventRegistry::string_list dead_handlers = event_registry->UnusedHandlers();
#pragma GCC diagnostic pop
if ( ! dead_handlers.empty() && check_for_unused_event_handlers ) {
for ( const string& handler : dead_handlers )