This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Q. is sizeof(char) always 1
- To: egcs-bugs at cygnus dot com, grahams at rcp dot co dot uk
- Subject: Re: Q. is sizeof(char) always 1
- From: mrs at wrs dot com (Mike Stump)
- Date: Fri, 25 Sep 1998 14:27:50 -0700
> 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'