ComputeCpp's internal headers trigger warnings

I’m trying to integrate ComputeCpp into alpaka’s CMake-based build system. For our test cases we enable a lot of warnings and compile with -Werror. ComputeCpp’s internal headers cause a lot of warnings that result in a failing build when the following flags are enabled:

  • -Wreserved-id-macro
  • -Wdocumentation-unknown-command
  • -Wundef
  • -Wextra-semi
  • -Wshadow-field-in-constructor
  • -Wdouble-promotion
  • -Wnewline-eof
  • -Wdocumentation
  • -Wunused-parameter
  • -Wsign-conversion
  • -Wdeprecated
  • -Wshadow
  • -Wexit-time-destructors
  • -Wold-style-cast

Apart from disabling these warnings they can be silenced by including ComputeCpp’s headers as SYSTEM headers but I’m not sure if this may cause unwanted side effects. For reference, this is the compiler command line CMake uses (stripped include directories and other alpaka-related flags):

compute++ -DSYCL_LANGUAGE_VERSION=2020 \
          -I/home/stepha27/sycl-workspace/computecpp/include \
          -I/home/stepha27/software/computecpp-sdk/include \
          -O3\
          -DNDEBUG\
          -Werror\
          -Weverything\
          -Wno-c++98-compat\
          -Wno-c++98-compat-pedantic\
          -Wno-disabled-macro-expansion\
          -Wno-global-constructors\
          -Wno-padded\
          -sycl-driver\
          -fno-sycl-address-space\
          -Wsycl-known-virtual\
          -sycl-target spir64\
          -std=gnu++17\
          -o axpy.cpp.o -c axpy.cpp

Hi, thanks for reporting this. These checks should improve code, so we’ve created an internal issue to address them.

1 Like

Hi, quick update: we’ve just released ComputeCpp 2.5, which cleaned up the public headers against certain warnings:

  • -Wall , -Wextra , -Wundef , -Wextra-semi , -Wnewline-eof

Of course, there is more work to be done on this front, and we’ll continue cleaning up our headers when we have time.

1 Like

Another update on warnings cleaned up for ComputeCpp 2.6:

  • -Wdouble-promotion , -Wdeprecated , -Wmaybe-uninitialized , -Wold-style-cast
1 Like

More warnings cleaned up with ComputeCpp 2.7:

  • -Wunused-parameter , -Wshadow , -Wreserved-id-macro , -Wexit-time-destructors , -Wshadow-field-in-constructor
1 Like

Awesome! Three more to go :slight_smile: