News for hackers. Stuff that matters.
Re:Integers in C quiz by codeflo on Sunday September 04, 2022 @10:44AM (#32713599)
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.
Re:Integers in C quiz by veltas on Sunday September 04, 2022 @01:29PM (#32715449)
That second line can be written:

  *reg &= (uint8_t)~x;
Or:

  *reg &= ~x & 0xFF;