You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Pilch-Bisson <ke...@pilch-bisson.net> on 2003/12/08 17:24:47 UTC
RE: Unsupported printf positional parameters on Windows [was: Re:Resolution: only print specific error message when present]
> -----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
Re: Unsupported printf positional parameters on Windows [was: Re:Resolution:
only print specific error message when present]
Posted by Branko Čibej <br...@xbc.nu>.
Kevin Pilch-Bisson wrote:
>Windows FormatMessage(...) does support positional parameters.
>
>
Yes, brrrr, I was trying not to think about that horror. Mix "portable"
and "FormatMessage" in the same thought, and watch your brain explode. :-)
--
Brane Čibej <br...@xbc.nu> http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org