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

Avoid a -Warray-bounds false positive in GCC 13. #1639

Merged
merged 1 commit into from Aug 14, 2023
Merged

Avoid a -Warray-bounds false positive in GCC 13. #1639

merged 1 commit into from Aug 14, 2023

Conversation

svenpanne
Copy link
Contributor

The exact circumstances when this false positive is triggered are quite tricky to reproduce, but it happened reproducibly with g++ 13.1 and 13.2 in a close-source SW I'm working on. The fix even improves performance by a very tiny bit: There is no need to copy the std::smatch, having a const reference is enough.

Just as a side note: -Warray-bounds seems to cause trouble in other projects, too, so e.g. the Linux kernel has disabled since June 2022.

The exact circumstances when this false positive is triggered are quite
tricky to reproduce, but it happened reproducibly with g++ 13.1 and 13.2 in
a close-source SW I'm working on.  The fix even improves performance by a
very tiny bit: There is no need to copy the std::smatch, having a const
reference is enough.

Just as a side note: -Warray-bounds seems to cause trouble in other
projects, too, so e.g. the Linux kernel has disabled since June 2022.
@yhirose yhirose merged commit afe627e into yhirose:master Aug 14, 2023
4 checks passed
@yhirose
Copy link
Owner

yhirose commented Aug 14, 2023

@svenpanne Thanks for the contribution!

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 this pull request may close these issues.

None yet

2 participants