From a9e8f7e0533811be2cd7c9a88d9058da8caa1d11 Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 6 Oct 2007 02:42:29 +0000 Subject: PR1119: unused variable elision warnings 2007-10-05 Frank Ch. Eigler PR 1119 * elaborate.cxx (semantic_pass_opt[12]): Warn on elided variables/functions in user script. * session.h (suppress_warnings): New field. Change "timing" to plain old bool. * main.cxx (main): Configure warnings on by default. * stap.1.in: Document this. PR 1119. * systemtap.base/warnings.*: New test. * futexes.stp, sig_by_proc.stp, small_demos/rwtiming.stp: Fix elision warnings. --- main.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 09435fad..7d4b8133 100644 --- a/main.cxx +++ b/main.cxx @@ -71,6 +71,7 @@ usage (systemtap_session& s, int exitcode) << " -V show version" << endl << " -k keep temporary directory" << endl << " -u unoptimized translation" << (s.unoptimized ? " [set]" : "") << endl + << " -w suppress warnings" << (s.suppress_warnings ? " [set]" : "") << endl << " -g guru mode" << (s.guru_mode ? " [set]" : "") << endl << " -P prologue-searching for function probes" << (s.prologue_searching ? " [set]" : "") << endl @@ -200,10 +201,11 @@ main (int argc, char * const argv []) s.kernel_release = string (buf.release); s.architecture = string (buf.machine); s.verbose = 0; - s.timing = 0; + s.timing = false; s.guru_mode = false; s.bulk_mode = false; s.unoptimized = false; + s.suppress_warnings = false; #ifdef ENABLE_PROLOGUES s.prologue_searching = true; @@ -273,8 +275,8 @@ main (int argc, char * const argv []) while (true) { - // NB: also see find_hash(), help(), switch stmt below, stap.1 man page - int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uq"); + // NB: also see find_hash(), usage(), switch stmt below, stap.1 man page + int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqw"); if (grc < 0) break; switch (grc) @@ -292,7 +294,11 @@ main (int argc, char * const argv []) break; case 't': - s.timing ++; + s.timing = true; + break; + + case 'w': + s.suppress_warnings = true; break; case 'p': -- cgit