delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2008/04/24/09:24:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX18tE+ND+WctGyt2Lc9duEMBfm0/dBUCUa1Pop5a6K
3VaK6MMZovM2wI
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: Implementation of certain conversion specifiers in _doprnt
Date: Thu, 24 Apr 2008 16:25:18 +0200
User-Agent: KMail/1.9.5
MIME-Version: 1.0
Message-Id: <200804241625.20525.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019