On the contrary, in C you can put the default case anywhere you like,
it does not have to be last. Although it tends to make more sense to
humans when it is last. To quote from K&R second edition, section 3.4
"Cases and the default clause can occur in any order".
Just to make absolutely sure, look at the generated code.
kernel/signal.c, lines 53-55.
t->sigpending = 0;
sigemptyset(&t->signal);
q = t->sigqueue;
Generated code when compiling kernel/signal.c with the normal flags
plus -S -g.
.stabn 68,0,53,.LM6-flush_signals
.LM6:
movl $0,8(%eax)
.stabs "/usr/src/2.2.9/include/linux/signal.h",132,0,0,.Ltext1
.Ltext1:
.stabn 68,0,147,.LM7-flush_signals
.LM7:
movl $0,932(%eax)
.stabn 68,0,148,.LM8-flush_signals
.LM8:
movl $0,928(%eax)
.stabs "signal.c",132,0,0,.Ltext2
.Ltext2:
.stabn 68,0,55,.LM9-flush_signals
.LM9:
movl 944(%eax),%edx
The compiler has used <linux/signal.h>, lines 147-148 for the expansion
of sigemptyset. That is the optimized case for two words of signals,
not the default memset() code.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/