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

Can not build with gcc13 because suggestion warning #1132

Closed
VictorEijkhout opened this issue Sep 1, 2023 · 3 comments · Fixed by #1140
Closed

Can not build with gcc13 because suggestion warning #1132

VictorEijkhout opened this issue Sep 1, 2023 · 3 comments · Fixed by #1140
Assignees

Comments

@VictorEijkhout
Copy link

/work2/00434/eijkhout/msgsl/msgsl-4.0.0/tests/span_tests.cpp:333:33: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
    int arr3d[2][3][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
                                ^~~~
                                {   }

Can I turn off the Werror? Alternatively, this seems to be non-essential testing code, so can I not build the tests?

@dmitrykobets-msft
Copy link
Member

Hi @VictorEijkhout, I'll bring this up in the next maintainers' sync.

@jpr42
Copy link
Contributor

jpr42 commented Oct 12, 2023

Alternatively, this seems to be non-essential testing code, so can I not build the tests?

You can set -D GSL_TEST=OFF when configuring the CMake build.

This is also what vcpkg does in it's portfile.

https://github.com/microsoft/vcpkg/blob/b40de44891dc1cab11d4722094ae44807a837b98/ports/ms-gsl/portfile.cmake#L13

@hsutter
Copy link
Collaborator

hsutter commented Oct 18, 2023

Maintainers call: Yes this should be

int arr3d[2][3][2] = { { {1, 2}, {3, 4}, {5, 6} }, { {7, 8}, {9, 10}, {11, 12} } };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants