|
From: | Graham Davies |
Subject: | Re: [avr-gcc-list] Passing a string variable to lcd_puts |
Date: | Fri, 27 Mar 2009 16:31:59 -0400 |
David VanHorn wrote:
"Ok, so that leaves me VERY confused." Maybe it would help to think about logic levels in
simulation. The three basic levels are "low", "high" and "unknown".
The three variations of the char type are similar, signed, unsigned and
unspecified. I think that the reason the unspecified variant of char got
into the C language definition was political, not technical. The other
basic integer types don't share this quirk.
The compiler is probably warning you because a
signed char and an unsigned char are both different from an unspecified or plain
char, just like low and high are different from unknown.
The reason that a function would take a char of
unspecified signedness is that the writer of the function reasons that only the
least significant seven bits mean anything, so why bother with what the MSB
does. I think it's kind-of traditional that 7-bit ASCII is represented as
a plain char. Personally, I use uint8_t.
Graham.
|
[Prev in Thread] | Current Thread | [Next in Thread] |