--no-usage-warnings flag to suppress analysis

This commit is contained in:
Vern Paxson 2022-05-05 10:57:31 -07:00 committed by Tim Wojtulewicz
parent 763b448aef
commit d9479c0502
7 changed files with 29 additions and 7 deletions

View file

@ -107,6 +107,7 @@ void usage(const char* prog, int code)
fprintf(stderr, " -s|--rulefile <rulefile> | read rules from given file\n");
fprintf(stderr, " -t|--tracefile <tracefile> | activate execution tracing\n");
fprintf(stderr, " -u|--usage-issues | find variable usage issues and exit\n");
fprintf(stderr, " --no-usage-warnings | suppress warnings of unused functions/hooks/events\n");
fprintf(stderr, " -v|--version | print version and exit\n");
fprintf(stderr, " -w|--writefile <writefile> | write to given tcpdump file\n");
#ifdef DEBUG
@ -367,6 +368,7 @@ Options parse_cmdline(int argc, char** argv)
}
int profile_scripts = 0;
int no_usage_warnings = 0;
struct option long_opts[] = {
{"parse-only", no_argument, nullptr, 'a'},
@ -410,6 +412,7 @@ Options parse_cmdline(int argc, char** argv)
#endif
{"profile-scripts", optional_argument, &profile_scripts, 1},
{"no-usage-warnings", no_argument, &no_usage_warnings, 1},
{"pseudo-realtime", optional_argument, nullptr, '~'},
{"jobs", optional_argument, nullptr, 'j'},
{"test", no_argument, nullptr, '#'},
@ -613,6 +616,9 @@ Options parse_cmdline(int argc, char** argv)
activate_script_profiling(optarg);
profile_scripts = 0;
}
if ( no_usage_warnings )
rval.no_usage_warnings = true;
break;
case '?':