Casts to bool don't work.
I tried both implicit and explicit casts.
2.6.0 #4309 (Aug 16 2006) (UNIX)
It is the sdcc package from Debian unstable.
In the example below the function does return 0. This
can be seen in the generated assembly code:
; Dump of IC_LEFT: type AOP_LIT size 1
According to the C standard it should return 1:
"When any scalar value is converted to _Bool, the
result is 0 if the value compares equal to 0; otherwise
the result is 1."
It seems sdcc compares only the least significant byte
I compiled the example below with sdcc -c -mz80 --std-c99
unsigned int i = 256;
Log in to post a comment.