By "intuitive" I mean given
int a = -1;
unsigned int b = 3;
expression (a < b)must be evaluated at 1.
There are several questions that Stackoverflow already asks why, in a particular case, the C compiler complains about signature / unsigned matching. The answers come down to whole conversion rules and the like. However, there seems to be no justification for why the compiler should be so dumb when comparing integers and single integers. Using the declarations above why an expression like
(a < b)
not automatically replaced by
(a < 0 || (unsigned int)a < b)
if there is no single machine instruction to do it right?
" , - ". , libc (, sprintf() int , send() ssize_t ..).
, , , , ( (d - '0' < 10U)) C (((unsigned int)(d - '0') < 10U)). , , .
, , , ( , ). , ? , , ?