I have a C code, in which a do loop is started in the first branch of a switch statement. What is weird, is that the rest of the branches of the switch statement are inside the body of the do loop. First, how is it possible that this code compiles? Second, what does it possibly do?
void f(char *x, char *y, int z) {
int z2 = (z + 7) / 8;
switch(z % 8) {
case 0: do { *x++ = *y++;
case 7: *x++ = *y++;
case 6: *x++ = *y++;
case 5: *x++ = *y++;
case 4: *x++ = *y++;
case 3: *x++ = *y++;
case 2: *x++ = *y++;
case 1: *x++ = *y++;
} while(--z2 > 0);
}
}