[patch] give alternates for read only variable warning

Stan Cox scox@redhat.com
Sat Jun 14 03:06:00 GMT 2008


-> nl -ba /work/scox/systemtap/src/testsuite/systemtap.base/warnings.stp
     1  # PR 1119
     2
     3  global elide_me1
     4  function elide_me2 () {}
     5  function foo:long () { elide_me3 = 1 }
     6  function bar() { print(elide+me1) ; ; ; }
     7  probe never { elide_me4 = 1; (elide_me5+5); print (foo()) }
     8  probe never { print(elide+me1) bar () }
     9
    10  # PR 6611
    11
    12  probe probea = kernel.statement("bio_init@fs/bio.c:135")
    13                 { printf("%d", funca(2)); elide_me6="foo" }
    14  probe probea { printf("%d", funcb(2,3)); printf("%s",var) }
    15
    16  function funcb(a:long, b:long) {return a + b}
    17  function funca(a:long) {a=b; elide_me7=1; return a}

-> stap -p2 /work/scox/stap/6611.stp
WARNING: eliding unused function identifier 'elide_me2'
at /work/scox/stap/6611.stp:4:10
WARNING: read-only local variable identifier 'elide_me5'
at /work/scox/stap/6611.stp:7:31
         (alternatives: elide_me4 elide_me1)
WARNING: read-only local variable identifier 'elide'
at /work/scox/stap/6611.stp:8:21
         (alternatives: me1 elide_me1)
WARNING: read-only local variable identifier 'me1'
at /work/scox/stap/6611.stp:8:27
         (alternatives: elide elide_me1)
WARNING: read-only local variable identifier 'var'
at /work/scox/stap/6611.stp:14:54
         (alternatives: elide_me6 elide_me1)
WARNING: read-only local variable identifier 'elide'
at /work/scox/stap/6611.stp:6:24
         (alternatives: me1 elide_me1)
WARNING: read-only local variable identifier 'me1'
at /work/scox/stap/6611.stp:6:30
         (alternatives: elide elide_me1)
WARNING: read-only local variable identifier 'b'
at /work/scox/stap/6611.stp:17:27
         (alternatives: a elide_me7 elide_me1)
WARNING: eliding unused variable identifier 'elide_me1'
at /work/scox/stap/6611.stp:3:8
WARNING: side-effect-free function 'foo' identifier 'foo'
at /work/scox/stap/6611.stp:5:10
WARNING: eliding unused variable identifier 'elide_me4'
at /work/scox/stap/6611.stp:7:15
WARNING: eliding unused variable identifier 'elide_me5'
at /work/scox/stap/6611.stp:7:31
WARNING: eliding unused variable identifier 'elide_me6'
at /work/scox/stap/6611.stp:13:42
WARNING: eliding unused variable identifier 'elide_me3'
at /work/scox/stap/6611.stp:5:24
WARNING: eliding unused variable identifier 'elide_me7'
at /work/scox/stap/6611.stp:17:30

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rovaralt.patch
Type: text/x-patch
Size: 4326 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080614/d0360fe9/attachment.bin>


More information about the Systemtap mailing list