You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2003/12/06 21:36:26 UTC
Re: Resolution: only print specific error message when present
Greg Hudson <gh...@MIT.EDU> writes:
> I think it is much more important to display brief, elegant,
> non-redundant error messages than it is to be able to reverse-map an
> error message to an error code. Error codes are for programs, not for
> people. Given only the specific error message, one should still
> usually be able to reverse-map to a location in the source where the
> error is generated. (And, of course, enable-maintainer-mode builds
> will display that information along with the error.)
My biggest concern about our error code system is that localization in
the future is going to be a nightmare. At least with the redundant
error message strings, we have a single place to hook in a
localization system. But on the flip-side, I agree that the redundant
messages are not the most useful things in the world -- in an error
condition, the more details we can give, the better.
---------------------------------------------------------------------
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 Paul Smith <pa...@nortelnetworks.com>.
%% Julian Foad <ju...@btopenworld.com> writes:
>> "%2$d Zeichen lang ist die Ziechenkette '%1$s'\n"
>> Apparently, Windows doesn't have this support.
jf> Nor does standard C, so you can't rely on any platform having
jf> support for this.
Although not required by ISO C (yet?), they _are_ required by POSIX
standards. FYI.
--
-------------------------------------------------------------------------------
Paul D. Smith <ps...@nortelnetworks.com> HASMAT--HA Software Mthds & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.
---------------------------------------------------------------------
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 Julian Foad <ju...@btopenworld.com>.
Greg Hudson wrote:
> 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.
Thanks; I didn't know what you meant by "printf positional parameters" because I had never come across them.
> "%2$d Zeichen lang ist die Ziechenkette '%1$s'\n"
>
> Apparently, Windows doesn't have this support.
Nor does standard C, so you can't rely on any platform having support for this.
> 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.
Yes, OK, I suppose we could implement them in APR.
It certainly sounds like a useful feature for this purpose.
- Julian
---------------------------------------------------------------------
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
RE: Unsupported printf positional parameters on Windows [was: Re:Resolution: only print specific error message when present]
Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
> -----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 Greg Hudson <gh...@MIT.EDU>.
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Unsupported printf positional parameters on Windows [was: Re: Resolution:
only print specific error message when present]
Posted by Julian Foad <ju...@btopenworld.com>.
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?
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Resolution: only print specific error message when present
Posted by Branko Čibej <br...@xbc.nu>.
Greg Hudson wrote:
>On Sat, 2003-12-06 at 16:36, C. Michael Pilato wrote:
>
>
>>My biggest concern about our error code system is that localization in
>>the future is going to be a nightmare. At least with the redundant
>>error message strings, we have a single place to hook in a
>>localization system.
>>
>>
>
>I don't get it. How does my proposal make this any worse?
>
>
It's not. We can mark the generic messages for localisation with no
trouble, and svn_error_create[f] will have to call gettext anyway.
I'm much more concerned about the nightmare of unsupported printf
positional parameters on Windows...
--
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
Re: Resolution: only print specific error message when present
Posted by Greg Hudson <gh...@MIT.EDU>.
On Sat, 2003-12-06 at 16:36, C. Michael Pilato wrote:
> My biggest concern about our error code system is that localization in
> the future is going to be a nightmare. At least with the redundant
> error message strings, we have a single place to hook in a
> localization system.
I don't get it. How does my proposal make this any worse?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org