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

Fix gcc-10.1 C++20 warnings #3718

Merged
merged 2 commits into from
Jan 13, 2021
Merged

Conversation

masterleinad
Copy link
Contributor

Accompanying #3716. This fixes

warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 120 equals destination size [-Wstringop-truncation]

which was the only warning with -std=c++2a using gcc-10.1.
Note that we set the last element to \0 anyway in the next line.

@nliber
Copy link
Contributor

nliber commented Jan 13, 2021

Yeah, I saw that it was correct when it was checked in before, even if gcc can't see that. :-). Anyway, this change is fine.

@masterleinad
Copy link
Contributor Author

Ready from my side. Needs more reviews.

Copy link
Member

@Rombur Rombur left a comment

Choose a reason for hiding this comment

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

This looks good. Do you mind also unifying the way we set the last character. Right now, we use (char) 0, \0, and 0.

@crtrott crtrott merged commit 3d5be44 into kokkos:develop Jan 13, 2021
dalg24 added a commit to dalg24/kokkos that referenced this pull request Jan 13, 2021
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

5 participants