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, Feb 25, 2007 at 08:53:50PM +0100, Jan Kratochvil wrote:
> 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?

RMS wrote:

> 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.

For myself, I think the new behavior is clearly better overall, and
that relatively few packages rely on sign-specified character types
for strings; that's why I approved Jan's patch.  I even proposed an
extension that I would find even more useful, to suppress the
single-quoted characters for arrays of signed or unsigned byte
variables.  (No one's commented on that; I'll wait until we decide
about this one first.)

Do you think that Emacs's behavior - an important GNU application, but
only one - changes the overall situation?  I don't, and I am generally
opposed to backing this change out.  I believe there are more
applications which use single byte arrays for numerical data than for
character data.  We can document how to produce string output more
clearly in the manual, perhaps?

-- 
Daniel Jacobowitz
CodeSourcery


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