On Thu, 8 Aug 2002, Ashley Yakeley wrote:
At 2002-08-08 02:56, Patryk Zadarnowski wrote:
1990 ANSI/ISO C requires chars to be at least 8 bits wide in section 5.2.4.2.1. This extends to ANSI/ISO C++, which cites ISO C for its definition of <limits.h>. Haven't got C'99 handy, but it'll be a similar story - char is *at least* 8 bits wide.
Hope that satisfies the pedants.
But there's no guarantee that char is exactly 8 bits wide, is there? So it's appropriate to have separate types, CChar/CSChar/CUChar and Word8/Int8.
No, and neither are there any guarantees about there being *any* specific-width integer types at all! If you're worried about char not being 8 bit, it's likely that the C compiler won't provide an 8 bit integer, either, so Word8/Int8 doesn't solve the problem. Although, it's beyond me why the C standard should dictate anything about Haskell, especially the arcane and obscure dark corners of it such as the sizes of integer types. No Haskell compilers compile to pure ISO C anyway. Pat.