3 ms·
I don’t find that very convincing. It’s simply ambiguous, I might want this: *reg &= ~(uint64_t)x; or, and there’s no elegant way to even write this in C,
by codeflo 4y ago
I don’t find that very convincing. It’s simply ambiguous, I might want this:
*reg &= ~(uint64_t)x;
or, and there’s no elegant way to even write this in C, I might want:
*reg &=(uint64_t)(uint8_t)~x;
The fact that I have to write two casts here to undo the damage of the auto-promotion is evidence of how broken this is.
- veltas 4y agoThat second line can be written: *reg &= (uint8_t)~x; Or: *reg &= ~x & 0xFF;