Page MenuHomeFreeBSD

hid: quiet -Wswitch
ClosedPublic

Authored by rlibby on Sun, Jan 10, 7:59 AM.

Details

Summary

Gcc builds complained that not all switch cases are handled. Add empty
cases to appease gcc.


Please feel free to take this over and solve in any way you see fit. I
have just posted this review for expediency in case this is your
preferred approach.

Also, I am not sure whether this code has an upstream. Please advise if
so.

Test Plan
env MAKEOBJDIRPREFIX=/usr/obj/gcc9 CROSS_TOOLCHAIN=amd64-gcc9 make buildkernel

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This revision is now accepted and ready to land.Sun, Jan 10, 9:37 AM

Why not just add default: ? Anyways looks good.

Why not just add default: ? Anyways looks good.

Yes. default: looks better.

The advantage of listing cases instead of using default would be that if another enum value ever gets added, then the compiler's warning about unhandled cases won't have been suppressed. But I agree it's uglier. I'll change it to default.

Feedback: use default instead of listing cases

This revision now requires review to proceed.Sun, Jan 10, 7:57 PM
This revision is now accepted and ready to land.Sun, Jan 10, 9:29 PM
This revision was automatically updated to reflect the committed changes.