Skip to content

Conversation

aelovikov-intel
Copy link
Contributor

Fixes #15063.

@AlexeySachkov
Copy link
Contributor

We have a test for warnings coming out of our headers: sycl/test/warnings/warnings.cpp, but it didn't help in this case. Do you know if we can maybe do some updates to it to prevent cases like this happen in the future?

I've tried locally to add -Wcomment in there, but it didn't work.
I wonder if we need to run that test with gcc as well to have a better coverage.

@dvrogozh
Copy link

I wonder if we need to run that test with gcc as well to have a better coverage.

Yes, you need gcc as host compiler and use -Wall. The following reproduces the warning on my side on ubuntu 22.04:

$ cat a.cpp
#include <sycl/sycl.hpp>
int main(int argc, char** argv) {}

$ PATH=build/install/bin/:$PATH LD_LIBRARY_PATH=build/install/lib clang-19 -fsycl -fsycl-host-compiler=g++ -fsycl-host-compiler-options="-Wall" ~/tmp/a.cpp
In file included from /home/dvrogozh/git/llvm/build/install/bin/../include/sycl/builtins.hpp:13,
                 from /home/dvrogozh/git/llvm/build/install/bin/../include/sycl/detail/image_accessor_util.hpp:17,
                 from /home/dvrogozh/git/llvm/build/install/bin/../include/sycl/accessor_image.hpp:4,
                 from /home/dvrogozh/git/llvm/build/install/bin/../include/sycl/sycl.hpp:13,
                 from /home/dvrogozh/tmp/a.cpp:1:
/home/dvrogozh/git/llvm/build/install/bin/../include/sycl/detail/builtins/builtins.hpp:235:1: warning: multi-line comment [-Wcomment]
  235 | // clang++ -[DU]__SYCL_DEVICE_ONLY__ -x c++ math_functions.inc  \
      | ^

$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@aelovikov-intel
Copy link
Contributor Author

I wonder if we need to run that test with gcc as well to have a better coverage.

I wouldn't expect our headers to be warning-clean in that scenario even after this PR. IMO, that should be a separate activity to craft a working test and then to clean all of the warnings it will detect.

@AlexeySachkov
Copy link
Contributor

I wonder if we need to run that test with gcc as well to have a better coverage.

I wouldn't expect our headers to be warning-clean in that scenario even after this PR. IMO, that should be a separate activity to craft a working test and then to clean all of the warnings it will detect.

No objections to that, I've submitted #15081 to follow-up

@aelovikov-intel aelovikov-intel deleted the fix-wcomment branch July 25, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warning: multi-line comment coming from sycl header files [-Wcomment]

4 participants