Subject: Re: new stdlib?
To: None <mcr@sandelman.ottawa.on.ca, paul@wakawaka.com>
From: Paul Sander <paul@wakawaka.com>
List: netbsd-help
Date: 02/09/2000 19:53:08
According to one person who has written an implementation of these functions,
it can be done by making multiple passes over the format string:  Allocate
a new parameter array containing type and pointer pairs, populate the array
using varargs or stdargs (which don't require the arguments to be the same
size), and finally format the output as listed in the populated array.

Note that this doesn't work so well if the format string omits one or more
arguments.

--- Forwarded mail from mcr@sandelman.ottawa.on.ca

>>>>> "Paul" == Paul Sander <paul@wakawaka.com> writes:
    Paul> The %m$nd format has to do with the XPG4 standard, as defined by The Open
    Paul> Group (formerly X/Open and OSF, I believe).  It allows the rearrangement of
    Paul> the arguments with regard to localization.

  My understanding is that this only works if you can guarantee that all
arguments are of the same size, which is not the case in ANSI C anymore since 
you don't have to do default promotion rules.
  I wonder how they get it to work?

--- End of forwarded message from mcr@sandelman.ottawa.on.ca