Liste des Groupes | Revenir à cl c |
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:>
>(I'd like to a future standard require plain char to be unsigned,>
but I don't know how likely that is.)
It seems unnecessary given that the upcoming C standard
is choosing to mandate two's complement for all signed
integer types.
It's less necessary, but I'd still like to see it.
>
These days, strings very commonly hold UTF-8 data. The fact that bytes
whose values exceed 127 are negative is conceptually awkward, even if
everything happens to work. It rarely if ever makes sense to treat a
character value as negative.
(And of course signed char still exists,
or int8_t if you prefer 8 bits vs. CHAR_BIT bits.)
A drawback is that it could break existing (non-portable) code that
assumes plain char is signed.
Les messages affichés proviennent d'usenet.