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]

Re: Wide characters and GCC


On Mon, 11 Jun 2001, Michael Hayes wrote:

> While chars are stored as 32-bits on the C4x there is an underlying
> assumption that only the 8 LSBs are significant.  Since sizeof(char)
> = sizeof(short) = sizeof(int) on the C4x, you generally would use an
> int type to store larger constants.

ISO C says that all bits of unsigned char are significant.  While C99
allows signed char to have padding bits, ISO C++ doesn't.  (Also, I doubt
GCC really supports integer types with padding bits, even though
c-tree.texi documents what TYPE_SIZE and TYPE_PRECISION are for them.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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