warning: unused type alias 'Fn' with Cray and IBM compilers

Issue #247 resolved
Paul Hargrove created an issue

Initial attempts to use IBM XL compilers yield the following, which appear to be correctly identified unused definitions:

/autofs/nccs-svm1_home1/hargrove/upcxx/.nobs/art/2962a4074e7b6322fe5e6784d65e5fabfd0e55f7/upcxx/backend/gasnet/runtime.hpp:299:11: warning: unused type alias 'Fn' [-Wunused-local-typedef]
    using Fn = typename std::decay<Fn1>::type;
          ^
/autofs/nccs-svm1_home1/hargrove/upcxx/.nobs/art/2962a4074e7b6322fe5e6784d65e5fabfd0e55f7/upcxx/backend/gasnet/runtime.hpp:363:11: warning: unused type alias 'Fn' [-Wunused-local-typedef]
    using Fn = typename std::decay<Fn1>::type;
          ^

On Theta, I find that PrgEnv-cray + cce/9.0.2 complains similarly on numerous tests:

In file included from /lus/theta-fs0/projects/CSC250STPM17/upcnightly/EX-theta-aries-cray/runtime/work/opt/upcxx/test/regression/issue185.cpp:1:
In file included from /lus/theta-fs0/projects/CSC250STPM17/upcnightly/EX-theta-aries-cray/runtime/work/opt/upcxx/.nobs/art/869686e5aa3d3abd8b5c5148ec932002a0d45fa6/upcxx/upcxx.hpp:12:
In file included from /lus/theta-fs0/projects/CSC250STPM17/upcnightly/EX-theta-aries-cray/runtime/work/opt/upcxx/.nobs/art/869686e5aa3d3abd8b5c5148ec932002a0d45fa6/upcxx/allocate.hpp:8:
In file included from /lus/theta-fs0/projects/CSC250STPM17/upcnightly/EX-theta-aries-cray/runtime/work/opt/upcxx/.nobs/art/869686e5aa3d3abd8b5c5148ec932002a0d45fa6/upcxx/backend.hpp:254:
/lus/theta-fs0/projects/CSC250STPM17/upcnightly/EX-theta-aries-cray/runtime/work/opt/upcxx/.nobs/art/869686e5aa3d3abd8b5c5148ec932002a0d45fa6/upcxx/backend/gasnet/runtime.hpp:543:11: warning: unused type alias 'Fn' [-Wunused-local-typedef]
    using Fn = typename std::decay<Fn1>::type;
          ^
1 warning generated.

Since Cray is a supported compiler, this is not "trivial" any longer.
I am assigning priority of "minor" since it is only a warning.

Note both IBM's and Cray's compilers are using clang's front-end.
So, I would not be surprised to see this on Linux and macOS at some point.

Comments (5)

  1. Dan Bonachea

    This problem also occurs with every UPC++ user compile using gcc and clang if the user explicitly passes -Wunused, overriding the GEX-provided default of -Wno-unused.

    This currently appears to be the only such line in the public UPC++ headers tripping this warning.

    Proposed fix in pull request #139

  2. Dan Bonachea

    Fix issue #247: unused-local-typedef warning for some compilers

    This unused typedef was generating warnings from several compilers, including clang/gcc when the user explicitly passes -Wunused, overriding the GEX-provided default of -Wno-unused.

    This currently appears to be the only such line in the public UPC++ headers tripping this warning, so remove it.

    → <<cset e2f08129055a>>

  3. Log in to comment