This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6846] Full featured printf hooks
- From: "rsa at us dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 Nov 2008 22:31:16 -0000
- Subject: [Bug libc/6846] Full featured printf hooks
- References: <20080815064110.6846.rsa@us.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From rsa at us dot ibm dot com 2008-11-25 22:31 -------
Here's a first pass at a design document:
http://sources.redhat.com/glibc/wiki/PrintfHooksDesign
It needs a lot of cleanup to solidify some of the remaining implementation
questions.
Some of the important bits:
- Since the `__const struct printf_info *__info' parameter of
printf_arginfo_function is "const" the arginfo callback functions can't set
directly into it. If they want to set any special flags then they have to set
flags in __argstype in the range of 0xffff0000.
- With this in mind `struct printf_info' only needs the addition of one
additional word-sized user flag, rather than two. Once an override is detected
for a particular length-modifier the printf internals can simply copy the flags
in 0xffff0000 to `struct printf_info::user'.
- I've not thought of how to allow support for 'flag characters' yet since none
of the C-Spec proposals (VSX, Altivec, AVX, or DFP) define any overrides.
- The section `Design Preclusions::Questionable' should probably be answered. I
was able to come up with a design which didn't modify the existing `struct
printf_info' definition at all and I can present that design if you'd like.
- There's a lingering issue of `struct printf_info::spec' being defined as a
single wchar_t. This doesn't really work if we want to support multi-byte
'conversion specifications'. As far as I can tell none of the existing C-Spec
proposals define any multi-byte conv specs.
Thanks for the review.
Ryan
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6846
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.