Page MenuHomeFreeBSD

hid: quiet -Wswitch
ClosedPublic

Authored by rlibby on Jan 10 2021, 7:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 12:52 AM
Unknown Object (File)
Feb 7 2024, 2:00 AM
Unknown Object (File)
Feb 5 2024, 10:32 AM
Unknown Object (File)
Feb 2 2024, 2:47 AM
Unknown Object (File)
Dec 20 2023, 1:31 AM
Unknown Object (File)
Dec 11 2023, 11:05 PM
Unknown Object (File)
Dec 1 2023, 12:48 PM
Unknown Object (File)
Oct 16 2023, 5:12 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.