[Bug translator/17292] multi-line strings broken

dsmith at redhat dot com sourceware-bugzilla@sourceware.org
Tue Aug 19 19:38:00 GMT 2014


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

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
(In reply to Frank Ch. Eigler from comment #1)
> No, multi-line strings are not intended to be allowed.
> (Consecutive string literals are automatically concatenated,
> so one can say
> 
>     foo("bar\n" 
>         "baz")

Hmm, concatenating consecutive string literals sort of works. Here's the
script:

====
probe begin
{
    # This works.
    str1 = "hello" " there"
    printf("%s\n", str1)

    # This does not.
    printf("hello" "there\n")
}
====

Here's the output of stap. It likes the first string concatenation, but not the
second.

====
# stap -v ./str2.stp 
parse error: expected ','
    saw: string 'there\n' at ./str2.stp:8:17
     source:     printf("hello" "there\n")
                                ^

1 parse error.
Pass 1: parsed user script and 103 library script(s) using
215108virt/33408res/6136shr/27996data kb, in 210usr/40sys/254real ms.
Pass 1: parse failed.  [man error::pass1]
====

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



More information about the Systemtap mailing list