wprintf anybody?

Brian Dessent brian@dessent.net
Wed Apr 9 21:34:00 GMT 2008


Corinna Vinschen wrote:

> while we're at it, multibyte/wide chars and all, I just found that it
> would be helpful to have the wprintf family of functions, and possibly
> related stuff like fputwc, fputws, fgetwc, fgetws and fwide.  Is anybody
> here interested in adding this to Cygwin or, FWIW, newlib?

I had a tentative spot on my TODO to simply audit Cygwin+newlib for the
current state of C99 wchar_t support, and make a list of what all is
missing.  I have a feeling it's a lot, but I agree that low hanging
fruit like wprintf would be a good idea to have.  I'm sure that
libstdc++ could benefit from this, since at the moment I think it has
all wide character support disabled due to no underlying libc support.

Oh and that reminds me... There is this little gem in syscalls.cc:

/* FIXME: to do this right, maybe work out the usoft va_list machine
   and use wsvprintfW instead?
*/
extern "C" int
wprintf (const char *fmt, ...)
{
  va_list ap;
  int ret;

  va_start (ap, fmt);
  ret = vprintf (fmt, ap);
  va_end (ap);
  return ret;
}

Naturally, we never exported this function so it didn't cause any
damage.  But from what I can tell from a dig through the ChangeLogs,
this little guy dates back to at least 1996, and he's just been sitting
there doing nothing and being useless the whole time.

Brian



More information about the Cygwin-developers mailing list