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/10242] sprintf does not recognize "%-*s" conversion specifier


------- Additional Comments From varunc at linux dot vnet dot ibm dot com  2009-06-08 03:06 -------
stap -e 'probe begin { j = 10; aff = "aff"; s = sprintf("%-*s %-*s %-*s %-11s
%-3s %3ld %8ld %5ld %5ld %3ld %11ld %6ld %7ld %13ld %ld", 23, aff, 8, aff, 23,
aff, aff, aff, j,j,j,j,j,j,j,j,j,j); printf("|%s|\n", s); exit() }'
parse error: invalid or missing conversion specifier
        saw: string '%-*s %-*s %-*s %-11s %-3s %3ld %8ld %5ld %5ld %3ld %11ld
%6ld %7ld %13ld %ld' at <input>:1:48
     source: probe begin { j = 10; aff = "aff"; s = sprintf("%-*s %-*s %-*s
%-11s %-3s %3ld %8ld %5ld %5ld %3ld %11ld %6ld %7ld %13ld %ld", 23, aff, 8, aff,
23, aff, aff, aff, j,j,j,j,j,j,j,j,j,j); printf("|%s|\n", s); exit() }

The above seem to fail in my case. This works fine when i run it as plain c
code. Did i miss something obvious?(In reply to comment #1)
> Can you give a more complete example of what's not working for you?  I tried the
> following and it looks fine:
> 
> $ stap -e 'probe begin { aff = "aff"; s = sprintf("%-*s", 23, aff);
> printf("|%s|\n", s); exit() }'
> |aff                    |
> 



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10242

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


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