On 08/18/2011 08:00 AM, Pádraig Brady wrote:

Perhaps a printf format spec?
%h is available,

No it's not. printf %hx prints a short int, printf %hhx prints a char as an int.

Meanwhile, although both the bash builtin and coreutils' printf parse these two formats, they actually still end up widening to int before printing; arguably a bug:

$ printf %hhx -1
ffffffffffffffff
$ echo 'format(%hx,-1)' | m4
ff

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to