This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Signed/unsigned character arrays are not strings


On Sun, 25 Feb 2007 08:59:41 +0100, mathieu lacage wrote:
...
> I don't know how useful that is to you but a lot of people (the first
> which comes to my mind is libxml2) decided to use "unsigned char *" to
> identify utf-8 encoded strings in C.

Together with the attached RMS's response I became more inclined to revert this
change and provide only "$xmm"-specific fix instead (probably for the GDB
int8_t/uint8_t internal types).

OK to submit the patch?


Jan
--- Begin Message ---
    the recent GDB has problems running GDB `xbacktrace' on EMACS
    http://sources.redhat.com/ml/gdb/2007-02/msg00252.html

It seems clear why the change was made:

	On the other hand byte arrays become unreadable if printed as strings.

However, it seems that their hope this would not bother anyone was based
on an assumption which is inaccurate:

      I hope nobody uses sign-specification for strings.

Which GDB behavior is better is a matter of how often each one is
convenient and how often it causes trouble.  I don't know enough to
have an opinion about that, but if neither one is clearly better
overall, it would be best to leave GDB the way it was.


--- End Message ---
--- Begin Message ---
    2000-01-04  Gerd Moellmann  <gerd@gnu.org>

	    * lisp.h (struct Lisp_String): Make DATA member `unsigned char *'.

    I guess the questions to ask are:

    1) Why was this change made?

Probably to make it easier to avoid incorrect conversions when
extracting elements.  We don't want to get negative numbers
for byte values above 127.

--- End Message ---

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]