From 2e526dabcf4b15fb102e295b282df3af54d5c9d3 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Mon, 19 Oct 2009 11:33:24 -0400 Subject: PR10799: warn on possibly uintended local-vs-global namespace collision * elaborate.cxx (find_var): Take extra token parameter. Look for cross-file global variable resolution, signal a warning. * testsuite/systemtap.examples/io/traceio2.stp: Fix it. * testsuite/systemtap.syscall/sys.stp: Fix it. * NEWS: Document it. --- NEWS | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 9fe26ba6..2c7ca4a6 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,18 @@ * What's new +- Systemtap now warns about global variables being referenced from other + script files. This aims to protect against unintended local-vs-global + namespace collisions such as: + + % cat some_tapset.stp + probe baz.one = bar { foo = $foo; bar = $bar } + % cat end_user_script.stp + global foo # intended to be private variable + probe timer.s(1) { foo ++ } + probe baz.* { println(foo, pp()) } + % stap end_user_script.stp + WARNING: cross-file global variable reference to foo from some_tapset.stp + - Preprocessor conditional for kernel configuration testing: %( CONFIG_foo == "y" %? ... %) -- cgit