This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/16097] New: improve error message on array type mismatch


https://sourceware.org/bugzilla/show_bug.cgi?id=16097

            Bug ID: 16097
           Summary: improve error message on array type mismatch
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jlebon at redhat dot com

Run the following:

$ stap -p2 -e '

global array

function str_ret_type() {
   return "hi"
}

probe begin {
   array[0] = 1
   array[1] = str_ret_type()
}
'

And you'll get as errors:

semantic error: type mismatch (long vs. string): identifier 'array' at
<input>:3:8
        source: global array
                       ^

semantic error: type was first inferred here (string): identifier 'array' at
:10:4
        source:    array[0] = 1
                   ^

Pass 2: analysis failed.  [man error::pass2]

It seems strange to point out the array declaration as the place of the
mismatch. It would be more helpful if it mentioned the array[1] line instead,
where the real mismatch happens.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]