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. --- testsuite/systemtap.base/warnings.exp | 16 ++++++++++++++++ testsuite/systemtap.base/warnings.stp | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 testsuite/systemtap.base/warnings.exp create mode 100644 testsuite/systemtap.base/warnings.stp (limited to 'testsuite/systemtap.base') diff --git a/testsuite/systemtap.base/warnings.exp b/testsuite/systemtap.base/warnings.exp new file mode 100644 index 00000000..90409d18 --- /dev/null +++ b/testsuite/systemtap.base/warnings.exp @@ -0,0 +1,16 @@ +set test "warnings" + +spawn stap -p4 $srcdir/$subdir/warnings.stp +set ok 0 +expect { + -re {^WARNING:[^\r\n]*\r\n} { incr ok; exp_continue } + -re {^[^\r\n]*.ko\r\n} { incr ok; exp_continue } + timeout { fail "$test (timeout)" } + eof { } +} +wait +if {$ok == 6} { + pass $test +} else { + fail $test +} diff --git a/testsuite/systemtap.base/warnings.stp b/testsuite/systemtap.base/warnings.stp new file mode 100644 index 00000000..a0ce8d8d --- /dev/null +++ b/testsuite/systemtap.base/warnings.stp @@ -0,0 +1,9 @@ +# PR 1119 + +global elide_me1 + +function elide_me2 () {} + +function foo:long () { elide_me3 = 1 } + +probe never { elide_me4 = 1; (elide_me5+5); print (foo()) } -- cgit