This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] linux-record: Squash cases with identical handling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]