This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Signed/unsigned character arrays are not strings
> Date: Thu, 25 Jan 2007 12:32:06 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org
> >
> > I must say I'm uneasy about this. Signedness could be random. What
> > will happen on platforms where `char' is unsigned by default?
>
> I had to find an answer to your interesting comment now myself:
>
> # The string identification works despite the compiler flags below due to
> # gdbtypes.c:
> # if (name && strcmp (name, "char") == 0)
> # TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
Thanks, I withdraw my objections.
> +@code{-funsigned-char} @value{GCC} options have no effect as @value{GDBN}
Please use @value{NGCC}, not @value{GCC}. The former produces output
similar to @value{GDBN}, the latter produces a literal lowercase "gcc".
> +* Arrays of specifically SIGNED or UNSIGNED CHARs are now printed as arrays
> + of numbers.
I think "explicitly SIGNED or UNSIGNED..." is a better wording.
Thanks.