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

clang -Werror: Kokkos_FixedBufferMemoryPool.hpp:140:28: error: unused parameter 'alloc_size' #2869

Closed
ndellingwood opened this issue Mar 14, 2020 · 3 comments
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@ndellingwood
Copy link
Contributor

ndellingwood commented Mar 14, 2020

clang/3.8.1, clang/4.0.1 Serial and Pthread and clang/8 nightly builds are failing with -Werror enabled with this message:

/home/jenkins/slave/workspace/Kokkos_develop_kokkos-dev_clang_381/kokkos/core/src/impl/Kokkos_FixedBufferMemoryPool.hpp:140:28: error: unused parameter 'alloc_size' [-Werror,-Wunused-parameter]

Reproducer sample:

 #   Load modules:
        module load sems-env sems-cmake/3.12.2 kokkos-env kokkos-hwloc/1.10.1/base sems-clang/3.8.1

  #   Use generate_makefile line below to call cmake which generates makefile for this build:
        <KOKKOS_PATH>/generate_makefile.bash --with-devices=Serial --arch=Kepler35 --compiler=/projects/sems/install/rhel6-x86_64/sems/compiler/clang/3.8.1/base/bin/clang++ --cxxflags="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized " --cxxstandard="11" --ldflags=""  --kokkos-path=<KOKKOS_PATH> --no-examples --with-options=enable_large_mem_tests
@ndellingwood ndellingwood added Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) Blocks Promotion Overview issue for release-blocking bugs DevelopOnly labels Mar 14, 2020
@ndellingwood ndellingwood added this to the Tentative 3.1 Release milestone Mar 14, 2020
@ndellingwood ndellingwood changed the title clang/3.8.1 -Werror: Kokkos_FixedBufferMemoryPool.hpp:140:28: error: unused parameter 'alloc_size' clang -Werror: Kokkos_FixedBufferMemoryPool.hpp:140:28: error: unused parameter 'alloc_size' Mar 14, 2020
@ndellingwood
Copy link
Contributor Author

ndellingwood commented Mar 14, 2020

Updated title, apparently this is not specific to older clang compilers. Looks to occur following PR #2838 ; in the allocate routine where this is triggered there is a macro KOKKOS_EXPECTS(alloc_size <= Size); that is called but only acts on args when debugging is enabled; maybe the non-debug should pass args on to KOKKOS_IMPL_SINK?

@ndellingwood
Copy link
Contributor Author

These macros all have potential to be problematic with -Wunused-parameter when the #else branch is hit:

#else // not debug mode
#define KOKKOS_EXPECTS(...)
#define KOKKOS_ENSURES(...)
#ifndef KOKKOS_ASSERT
#define KOKKOS_ASSERT(...)
#endif // ifndef KOKKOS_ASSERT
#endif // end debug mode ifdefs

@masterleinad
Copy link
Contributor

`` that is called but only acts on args when debugging is enabled; maybe the non-debug should pass args on to KOKKOS_IMPL_SINK?

We can just use

(void)alloc_size;

here. We were not seeing this one because we don't enable large memory tests in the CI.

@crtrott crtrott added InDevelop and removed Blocks Promotion Overview issue for release-blocking bugs labels Mar 16, 2020
@crtrott crtrott closed this as completed Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

3 participants