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 C-style cast warnings with clang-tidy #6860

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

masterleinad
Copy link
Contributor

Running clang-tidy locally with our current settings, I still see some complaints about C-style casts.

@masterleinad masterleinad marked this pull request as ready for review March 5, 2024 18:59
Copy link
Member

@crtrott crtrott left a comment

Choose a reason for hiding this comment

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

I don't really see the reason to have auto* there why not just auto:
https://godbolt.org/z/6Eo178jjx

Not blocking, I mean it might make it a bit clearer that we are looking at a const ptr, not a ptr of const. But still, if anyone else feels like get rid of * please feel free to say.

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

I agree with Christian suggesting to use auto instead of auto* in general but I don't think it is worth arguing about it, especially for that specific code.

@dalg24 dalg24 merged commit 82b0f2a into kokkos:develop Mar 6, 2024
31 of 33 checks passed
@masterleinad
Copy link
Contributor Author

Note that there is another clang-tidy check for this and that the LLVM Coding Standards advise to make it obvious if an auto-typed variable is a pointer, see https://clang.llvm.org/extra/clang-tidy/checks/readability/qualified-auto.html.

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.

3 participants