Page MenuHomeFreeBSD

hid: quiet -Wswitch
ClosedPublic

Authored by rlibby on Jan 10 2021, 7:59 AM.
Tags
None
Referenced Files
F102408388: D28082.diff
Mon, Nov 11, 9:11 PM
Unknown Object (File)
Thu, Nov 7, 2:37 PM
Unknown Object (File)
Tue, Oct 22, 11:21 AM
Unknown Object (File)
Oct 7 2024, 7:44 AM
Unknown Object (File)
Oct 7 2024, 6:45 AM
Unknown Object (File)
Oct 7 2024, 5:27 AM
Unknown Object (File)
Oct 6 2024, 3:45 PM
Unknown Object (File)
Oct 6 2024, 1:54 PM
Subscribers

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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36092
Build 32981: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jan 10 2021, 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.Jan 10 2021, 7:57 PM
This revision is now accepted and ready to land.Jan 10 2021, 9:29 PM
This revision was automatically updated to reflect the committed changes.