[Bug 221130] libxo anchor roles don't work as documented
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Jul 31 23:28:14 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130
Bug ID: 221130
Summary: libxo anchor roles don't work as documented
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: freebsd-bugs at FreeBSD.org
Reporter: markj at FreeBSD.org
I'm trying to use libxo anchor roles in a piece of code, but they're not
working as described in xo_format(5):
To give a width directly, encode it as the content of the anchor tag:
xo_emit("({[:10}{:min/%d}/{:max/%d}{]:})\n", min, max);
To pass a width as an argument, use "%d" as the format, which must appear
after the "/". Note that only "%d" is supported for widths. Using any
other value could ruin your day.
xo_emit("({[:/%d}{:min/%d}/{:max/%d}{]:})\n", width, min, max);
However, an attempt to follow this example leads to the width being printed:
$ xo "{[:/%d}{:address/%p}{]:}\n" 18 0xdeadbeef
0x12
$ xo "{[:18}{:address/%p}{]:}\n" 0xdeadbeef
0xdeadbeef
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list