Yeah they compile to the same machine code operations though. If those machine code operations aren't right as a bitfield then they aren't going to be right done manually either.
void bar(struct y *s, unsigned int foo) {
s->c = (s->c & 0xf0) | foo;
}Not always. Switch your example to AARCH64 and check out the BFI instruction.