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

Work around a GCC-12 warning about array accesses. #14029

Merged
merged 1 commit into from Jun 21, 2022

Conversation

drwells
Copy link
Member

@drwells drwells commented Jun 21, 2022

Fixes the warning in #13910 (comment)

This only occurs at higher optimization levels with -Warray-bounds.

@drwells
Copy link
Member Author

drwells commented Jun 21, 2022

If we are happy with this fix then I will cherry-pick onto 9.4.

static const ndarray<unsigned int, 3, 2> table = {
{{{0, 0}}, {{0, 1}}, {{1, 1}}}};
static const ndarray<unsigned int, 6, 2> table = {
{{{0, 0}}, {{0, 1}}, {{1, 1}}, {{X, X}}, {{X, X}}}};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that this has 5, not 6, entries. I'll push a patch.

I'm surprised ndarray lets us do this.

This only occurs at higher optimization levels with -Warray-bounds.
@masterleinad masterleinad merged commit 83b6002 into dealii:master Jun 21, 2022
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants