This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: C/C++ FEs: Do we really need three char_type_nodes?


Steven Bosscher wrote:

> +  if (signed_char)
> +    {
> +      char_type_node = make_signed_type (CHAR_TYPE_SISE);
> +      TYPE_CANONICAL (char_type_node) = signed_char_type_node;
> +    }

I don't think this is a good idea.  TYPE_CANONICAL is used for
type-comparison at the language level, and "char" and "signed char" are
different types -- even when "char" is signed.

For example:

   char* q;
   signed char *p = q;

is not valid without a cast.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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