Page MenuHomeFreeBSD

hid: quiet -Wswitch
ClosedPublic

Authored by rlibby on Jan 10 2021, 7:59 AM.
Tags
None
Referenced Files
F106136946: D28082.id82040.diff
Thu, Dec 26, 12:25 AM
F106134815: D28082.id82056.diff
Wed, Dec 25, 11:37 PM
F106134607: D28082.id82016.diff
Wed, Dec 25, 11:33 PM
F106104700: D28082.diff
Wed, Dec 25, 11:42 AM
Unknown Object (File)
Sun, Dec 22, 8:56 PM
Unknown Object (File)
Tue, Dec 10, 6:10 AM
Unknown Object (File)
Sat, Nov 30, 12:55 PM
Unknown Object (File)
Thu, Nov 28, 12:45 AM
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 36084
Build 32973: 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.