Initialisation of unsigned strings

Walter Murray walter at hpclwjm.HP.COM
Sat Jul 29 01:35:33 AEST 1989


>First I thought that gcc was being too pedantic, but unfortunately the May
>1988 draft seems to agree: 3.1.2.5 classifies "unsigned char" as an unsigned
>integer type, and 3.5.7 says that an array of character type may be initialised
>by a character string literal. Why could it not say "array of plain, signed or
>unsigned char"?

Note that "unsigned char" IS a character type, as well as an unsigned
integer type.  In the May, 1988, draft, see page 23, line 9 (3.1.2.5).
So it is legal to initialize an array of unsigned char with a character
string literal.

Walter Murray
Not speaking for X3J11
----------



More information about the Comp.std.c mailing list