This is the mail archive of the 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

Andreas Arnez <> writes:

> 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?

It is not my intention to stick to this rule.

> Or should we aim at getting GDB '-Wswitch'-clean?  (Probably a good idea

-Wswitch is enabled by -Wall, so gdb is '-Wswitch'-clean already.

> 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.

That will be overkill compared with your patch, so ...

>> 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.

... your patch except the fall-through is good to me.

Yao (éå)

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