This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/10242] sprintf does not recognize "%-*s" conversion specifier
- From: "varunc at linux dot vnet dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 8 Jun 2009 03:06:46 -0000
- Subject: [Bug translator/10242] sprintf does not recognize "%-*s" conversion specifier
- References: <20090605120255.10242.varunc@linux.vnet.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.