Mail Archives: djgpp-workers/2008/04/24/09:24:32
This collection of patches implements the grouping flag, the %[aAF] conversion
specifiers, the numeric conversion specifier and the modification required to
print nan/NAN instead of "Unnormal" for certain pseudo-numbers. This is
required to be compatible with GNU glibc and not to make break certain tests
generated by autoconf configure scripts. These patches have been produced by
splitting the patch produced for the latest version of libsupp. The following
four patches will be presented:
1) grouping flag implementation.
This flag is tested by configure and must be present if the library printf
function shall not be substituted by one from gnulib. Because there is only
C locale available, defacto nothings happens. The new function __grouping_format
does the job of grouping if the locale data is available. This function can
only be tested by hardcoding some usefull information in a locale structure
read out by _doprnt. I will not provide this test code because it clobbers
the _doprnt.c code.
2) nan/NAN and inf/INF, C99-strings.
The current implementation returns NaN and Inf. According to C99 the case
must match the case of the conversion specifier. Apart from this the
current implementation returns "Unnormal" for certain pseudo numbers being
incompatible with GNU glibc and making fail certain configure tests. This
has already been explained in:
<http://www.delorie.com/archives/browse.cgi?p=djgpp-workers/2008/03/16/08:29:08>
I have changed this and certain existing test programs accordingly.
3) Implementation of the %[aAF] conversion specifiers.
The way this works has already been explained a couple of months ago in:
<http://www.delorie.com/archives/browse.cgi?p=djgpp-workers/2007/10/19/16:38:22>
This feature is also tested by configure some times. The patch also
provides a test program to test the hex conversion specifier.
4) Implementation of numeric conversion specifier.
The way this works has already been explained a couple of months ago in:
<http://www.delorie.com/archives/browse.cgi?p=djgpp-workers/2008/03/04/14:29:15>
too. This patch provides two test programs to test all or a part of the
new features. printf4.c will be compiled by the makefile and test the hex
and the numeric conversion specifiers. printf5.c is an adapted version of
the test program that I distribute with libsupp and must be compiled manually
because it produces intentionaly warnings. It tests flags, conversion modifiers
and conversion specifiers. Due to the way it works it also test the snprintf
and the asprintf family of functions.
As usual suggestions, objections, comments are welcome.
If someone wants to test them in a local CVS copy, the patches must be applied
in the sequence they have been enumerated.
Regards,
Juan M. Guerrero
- Raw text -