gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] hackerlab, tla, and `char' signedness


From: Andy Tai
Subject: Re: [Gnu-arch-users] hackerlab, tla, and `char' signedness
Date: Thu, 12 Jan 2006 11:52:21 -0800

I have reservations about this...  while these warnings (also seen on x86) from gcc 4 are indications of possible problems, I am not sure in eacn case the intention of people when using char mean they are unsigned.

This may have other unseen consequences.  Maybe it is better to go to the code and fix the warnings.

Andy

On 1/12/06, Ludovic Courtès <address@hidden> wrote:
Hi,

Hackerlab and tla extensively use pointers to `t_uchar' to represent
strings.  However, `t_uchar' is different from `char' and unfortunately
C strings are of type pointer to `char' (not `signed char' nor `unsigned
char').  Therefore, we may get warnings such as "pointer targets differ
in signedness" (I do get them on PPC with GCC 4).

>From the GCC 4 manual:

  `-funsigned-char'
       Let the type `char' be unsigned, like `unsigned char'.


So I believe we should explicitly compile with `-funsigned-char'.

Thanks,
Ludovic.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]