[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: Kevin Pilch-Bisson <kevin_at_pilch-bisson.net>
Date: 2003-12-08 18:24:47 CET

> -----Original Message-----
> From: Greg Hudson [mailto:ghudson@MIT.EDU]
> Sent: Monday, December 08, 2003 7:45 AM
> To: Julian Foad
> Cc: dev@subversion.tigris.org
> Subject: Re: Unsupported printf positional parameters on Windows [was:
> Re:Resolution: only print specific error message when present]
>
> 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
> manual):
>
> "%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.

Windows FormatMessage(...) does support positional parameters.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/
formatmessage.asp

But I agree that this would be a good thing to add to apr_vformatter.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 8 18:26:42 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.