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

[C++] Clean up fallthrough Warnings #41891

Closed
WillAyd opened this issue May 30, 2024 · 1 comment
Closed

[C++] Clean up fallthrough Warnings #41891

WillAyd opened this issue May 30, 2024 · 1 comment
Assignees
Milestone

Comments

@WillAyd
Copy link
Contributor

WillAyd commented May 30, 2024

Describe the bug, including details regarding any error messages, version, and platform.

When going through a POC with Meson I noticed the following types of warnings appearing in a standard build:

../src/arrow/util/utf8_internal.h:185:44: warning: this statement may fall through [-Wimplicit-fallthrough=]
  185 |       state = internal::ValidateOneUTF8Byte(data[size - 7], state);
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
../src/arrow/util/utf8_internal.h:186:5: note: here
  186 |     case 6:
      |     ^~~~
../src/arrow/util/utf8_internal.h:187:44: warning: this statement may fall through [-Wimplicit-fallthrough=]
  187 |       state = internal::ValidateOneUTF8Byte(data[size - 6], state);
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
../src/arrow/util/utf8_internal.h:188:5: note: here
  188 |     case 5:

Should be easy enough to clean up

Component(s)

C++

@WillAyd WillAyd changed the title [C++] Clean up fallthrough and memaccess Warnings [C++] Clean up fallthrough Warnings May 30, 2024
WillAyd added a commit to WillAyd/arrow that referenced this issue May 30, 2024
WillAyd added a commit to WillAyd/arrow that referenced this issue Sep 19, 2024
WillAyd added a commit to WillAyd/arrow that referenced this issue Oct 2, 2024
WillAyd added a commit that referenced this issue Oct 2, 2024
### Rationale for this change

Helps clean up warnings, and at least one of these looks like a subtle bug that may confuse developers

### What changes are included in this PR?

Added break statements where case statements were previously falling through

### Are these changes tested?

Builds cleanly

### Are there any user-facing changes?

No

* GitHub Issue: #41891

Authored-by: Will Ayd <william.ayd@icloud.com>
Signed-off-by: Will Ayd <william.ayd@icloud.com>
@WillAyd WillAyd added this to the 18.0.0 milestone Oct 2, 2024
@WillAyd
Copy link
Contributor Author

WillAyd commented Oct 2, 2024

Issue resolved by pull request 41892
#41892

@WillAyd WillAyd closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant