A
aleksa
unsigned char X, Y;
if (X != (unsigned char) ~Y)
why do I get a warning here?
comparison of promoted ~unsigned with unsigned
As I understand, ~ promotes it to int,
but haven't I casted it back to a byte?
And, why does it work here?
unsigned char notb (unsigned char val) {
return ~val;
}
if (X != notb(Y))
if (X != (unsigned char) ~Y)
why do I get a warning here?
comparison of promoted ~unsigned with unsigned
As I understand, ~ promotes it to int,
but haven't I casted it back to a byte?
And, why does it work here?
unsigned char notb (unsigned char val) {
return ~val;
}
if (X != notb(Y))