Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What if you make the byte 16 bits? C99 doesn't require it to be exactly 8 bits--just that it be large enough to represent the basic character set.


FWIW, I've actually used a really silly chip once that had a horrible-tastic toolchain that it came with, where char and int were the same size, and both either 16 or 32 bits (I forgot whether it was 16 or 32, unfortunately). (In case anyone doesn't notice: on such a system, sizeof(int) is still 1, as it is measured in units of sizeof(char).)


Which chip? ADI's SHARC has that and it's far from "really silly"


I don't remember (this was 2002); I just remember it being a really cheap part on my friend's MicroMouse motor controller (I wrote the maze searching algorithm for them), and that the C compiler didn't actually work very well.


Then breaking a little quiz like this will be the least of your worries.

Of course, that's the kind of logic that got us into this situation today. Fortunately we should to be able to live with CHAR_BIT == 8 for the forseeable future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: