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 nvc++ compiler warnings #4014

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix nvc++ compiler warnings #4014

wants to merge 1 commit into from

Commits on Sep 19, 2022

  1. Fix nvc++ compiler warnings

    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.
    ```
    ".../tests/googletest-src/googletest/src/gtest-internal-inl.h", line 636: warning: unknown attribute "optimize" [unrecognized_attribute]
            GTEST_NO_INLINE_ GTEST_NO_TAIL_CALL_;
                             ^
    ```
    Issue google#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 google#3849.
    mhoemmen committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    cdaaf92 View commit details
    Browse the repository at this point in the history