Q. is sizeof(char) always 1

Mike Stump mrs@wrs.com
Fri Sep 25 14:28:00 GMT 1998


> From: grahams@rcp.co.uk
> Date: Fri, 25 Sep 1998 20:30:04 GMT
> To: egcs-bugs@cygnus.com

> The reason I'm asking this question is a lot of code in egcs assumes
> that sizeof(char) is 1 when allocating memory.

> Are bugs waiting to bite should a machine exist where
> sizeof(char) != 1

You might find reading the ANSI Standard for C++ enlightening:

`sizeof(char) , sizeof(signed char) and sizeof(unsigned char) are 1'



More information about the Gcc-bugs mailing list