Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I build the current stable branch (760060059fb746018a9849234e02dc9bf003861b) of the reference mdspan implementation (https://github.com/kokkos/mdspan) with nvc++ (either 22.7 or a pre-release version), I get a couple build warnings like the following.
Issue #3849 explains: GTest is using
#elif __GNUC__
to protect use of__attribute__((optimize("no-optimize-sibling-calls")))
. Many compilers that are not GCC define__GNUC__
to express some degree of compatibility with GCC extensions. This includes nvc++. nvc++ does not understand this attribute, so it emits a warning. My fix just disables use of that attribute if__NVCOMPILER
is defined.I've tested this fix with a pre-release (post-22.7) version of nvc++. It prevents the warning, and the reference mdspan implementation's tests build and run correctly.
Fixes #3849.