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

Improve warnings #66

Merged
merged 8 commits into from
Nov 20, 2024
Merged

Improve warnings #66

merged 8 commits into from
Nov 20, 2024

Conversation

BrendanKKrueger
Copy link
Collaborator

PR Summary

  • Eliminate some existing warnings
    • Some variables in the tests are only used for compile-time checks, and thus trip over unused-variable warnings. Decorate those with [[maybe_unused]].
    • Eliminated warnings about calling __host__-only functions from __host__ __device__ functions by replacing std::vector in some tests with a very simple non-trivial type.
    • Modify array::swap to be device-capable (std::swap is not constexpr until C++20).
    • Because the actual type used for std::size_t is platform and compiler dependent, @mauneyc-LANL would sometimes see warnings about comparing unsigned integers against zero. Replaced the checks that I could find with a small function that won't trip the warnings.
  • Copied the warning flags from Nautilus: adds more warnings, promotes warnings to errors.
  • Miscellaneous small changes for the new warning flags.

PR Checklist

  • Any changes to code are appropriately documented.
  • Code is formatted.
  • Install test passes.
  • Docs build.
  • If preparing for a new release, update the version in cmake.

…ed in compile-time expressions but are needed for the tests.
…nate warnings about calling __host__ functions from __host__ __device__ warnings.
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

Thanks for this cleanup! As soon as tests pass, I'm happy. I think the current tests issue is that span_EXPECTS needs to typedef'd to be defined explicitly to a no-op for non-debug builds to avoid this warning (now promoted to error):

#define span_EXPECTS(...) assert((__VA_ARGS__))

test/CMakeLists.txt Show resolved Hide resolved
@Yurlungur Yurlungur merged commit 1e0442b into main Nov 20, 2024
4 checks passed
@Yurlungur Yurlungur deleted the bkk_warnings branch November 20, 2024 16:50
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.

2 participants