how to format an error?

Andrew Cagney ac131313@cygnus.com
Sun Feb 3 19:22:00 GMT 2002


> Date: Sat, 02 Feb 2002 11:09:15 -0500
>> From: Andrew Cagney <ac131313@cygnus.com>
>> 
>> Wouldn't the gettext stuff let the german translator do this?
> 
> 
> gettext? what gettext? there _is_ no gettext in GDB ;-)


> Anyway, the specific case I cited was with system error messages
> returned by strerror.  These are not subject to translations.


My manual says:

     The strerror() function returns a pointer to the language-dependent error
     message string affiliated with an error number.


with a SEE ALSO to setlocale().  I guess something like:

   error ("Cannot perform exponentiation: %s", strerror (errno));

is ok, but:

   error ("%s on target_read", safe_strerror (err));

is really bad.

Andrew

(Hmm, I like the swapping between strerror and save_strerror ...)



More information about the Gdb mailing list