Found this in linux/kernel/signal.c
switch (_NSIG_WORDS) {
default:
for (i = 1; i < _NSIG_WORDS; ++i) {
x = *++s &~ *++m;
if (!x)
continue;
sig = ffz(~x) + i*_NSIG_BPW + 1;
break;
}
break;
case 2:
x = s[1] &~ m[1];
if (!x)
break;
sig = ffz(~x) + _NSIG_BPW + 1;
break;
case 1:
/* Nothing to do */
break;
}
Maybe this is not quite good example, but I can't understand how it works and what prompted Linus to put default-section at front of the switch statement.
x = *++s &~ *++m;
==x = (*(++s)) & (~(*(++m)));
..default:
is like any other case if you don't write as last you need to addbreak;
statement for same reason we other case