use CHAR_BIT for portability