Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallthroughs should be explicit #6047

Closed
r-barnes opened this issue Feb 20, 2024 · 1 comment
Closed

Fallthroughs should be explicit #6047

r-barnes opened this issue Feb 20, 2024 · 1 comment

Comments

@r-barnes
Copy link

The -Wimplicit-fallthrough flag identifies implicit fallthroughs and can make them into errors.

This is desirable because implicit fallthroughs have a high error rate.

For instance, this line looks like it should have a break before it.

To make fallthroughs explicit __attribute__((fallthrough)) can be added to the code. Adding a XNNPACK_FALLTHROUGH macro can make this compiler/language version dependent via preprocessor flags, if necessary.

@fbarchard
Copy link
Contributor

The instance you point to I dont think is a bug... the handling is shared?
XNNPack will sometimes do fall thru for efficiency in kernels too, but I'll look at each and see if a fix is needed, thanks.
The first warning I got on an XNNPack build is in pytorch/cpuinfo and I think a legit bug, so I sent a PR for that
pytorch/cpuinfo#225

copybara-service bot pushed a commit that referenced this issue Mar 18, 2024
Fixes #6047

PiperOrigin-RevId: 616821855
copybara-service bot pushed a commit that referenced this issue Mar 18, 2024
Fixes #6047

PiperOrigin-RevId: 616821855
copybara-service bot pushed a commit that referenced this issue Mar 19, 2024
Fixes #6047

PiperOrigin-RevId: 616821855
copybara-service bot pushed a commit that referenced this issue Mar 19, 2024
Fixes #6047

PiperOrigin-RevId: 616821855
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants