We are catching warnings from GCC 7 for implicit fall through in a switch statement. Previously, we cleared them under Clang (that\'s the reason for the comment seen below):
Clean C solution:
int r(int a) {
switch(a) {
case 0:
a += 3;
case 1:
a += 2;
default:
a += a;
}
return a;
}
becomes:
int h(int a) {
switch(a) {
case 0:
a += 3;
goto one;
case 1:
one:
a += 2;
goto others;
default:
others:
a += a;
}
return a;
}
EDIT: Moved the labels after case statements, as suggested by Stéphane Gourichon in comments, to see the fallthrough more easily.