This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] linux-record: Squash cases with identical handling
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, "Markus T. Metzger" <markus dot t dot metzger at intel dot com>
- Date: Wed, 13 Apr 2016 17:04:53 +0200
- Subject: Re: [PATCH] linux-record: Squash cases with identical handling
- Authentication-results: sourceware.org; auth=none
- References: <m3zisxdbgq dot fsf at oc1027705133 dot ibm dot com> <86ega9k97g dot fsf at gmail dot com>
On Wed, Apr 13 2016, Yao Qi wrote:
> I thought about squashing them too, but the reason I didn't do that is
> these enum gdb_syscall in the switch block are listed in the numeric
> order, so that it is quite easy to find whether a syscall is supported,
> or add a new syscall.
Ah, interesting point. If we want to stick to this rule, maybe this
should be stated in a comment above the switch statement?
Or should we aim at getting GDB '-Wswitch'-clean? (Probably a good idea
anyhow...) Then we could replace the default label by explicit case
labels for all unsupported syscalls and rely on GCC to catch any further
missing case labels. Once that's done, the order of case labels
wouldn't matter, IMO.
> but, I don't like the fall-through.
Yeah, it's kind of ugly. I can certainly drop this change from the
patch if that helps.
--
Andreas