[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Unsupported printf positional parameters on Windows [was: Re: Resolution: only print specific error message when present]

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2003-12-08 16:44:55 CET

On Mon, 2003-12-08 at 09:41, Julian Foad wrote:
> Branko Čibej wrote:
> >
> > I'm much more concerned about the nightmare of unsupported printf
> > positional parameters on Windows...
> Huh? Care to state briefly (but less briefly) what you mean by that, so I can at least try to avoid the problem when writing portable code?

I'm not sure which aspect you need an explanation of, so I'll explain
everything I know.

Let's say our code had

  printf(_("String '%s' has %d characters\n"), s, strlen(s));

An acceptable German translation might be (according to the gnu awk

  "%d Zeichen lang ist die Zeichenkette '%s'\n"

... but the arguments are in the wrong order. (I don't know any German;
maybe you could make the arguments be in the right order by rewording
the sentence, but assume that in many cases you can't.) So, folks added
support in printf for:

  "%2$d Zeichen lang ist die Ziechenkette '%1$s'\n"

Apparently, Windows doesn't have this support. But I don't see why that
matters; we almost exclusively use apr_psprintf. There doesn't appear
to be positional argument support in apr_vformatter(), but that's not a
Windows-specific problem, and we can presumably fix it with enough work.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 8 16:45:41 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.