• Timer, t1-t0, integral promotion
    For ARM7, A hardware timer is 32-bits, and unsigned int is 32-bits too; For a 16-bits MCU, A hardware timer is 16-bits, and unsigned int is 16-bits too; So, t0 = timer_val; while ( ( timer_val...
  • Timer, t1-t0, integral promotion
    For ARM7, A hardware timer is 32-bits, and unsigned int is 32-bits too; For a 16-bits MCU, A hardware timer is 16-bits, and unsigned int is 16-bits too; So, t0 = timer_val; while ( ( timer_val...
  • Type promotion bug?
    Specific pointer -> generic pointer -> boolean (i.e. implicit compare to 0) seems not to work as expected. void main() { char* p; char* q; char xdata* xp = NULL; bit fail = FALSE; // This...
  • Integer promotion bug
    I think there is a bug in the C51 and CX51 compilers regarding integer promotion. I have not deselected integer promotion and thus expect proper C semantics without adding casts. The bug seems to...
  • Type promotion bug?
    Specific pointer -> generic pointer -> boolean (i.e. implicit compare to 0) seems not to work as expected. void main() { char* p; char* q; char xdata* xp = NULL; bit fail = FALSE; // This...