Skip to content

[XPTI][NFC] Fix -Wconversion warnings #18786

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

Conversation

AlexeySachkov
Copy link
Contributor

-Wconversion is a must-have flag for us in according with internal guidelines (see AddSecurityFlags.cmake), but we have never built with it + -Werror so there are multiple places in xpti subproject where we did potentially incorrect implicit conversions.

`-Wconversion` is a must-have flag for us in according with internal
guidelines (see `AddSecurityFlags.cmake`), but we have never built with
it + `-Werror` so there are multiple places in `xpti` subproject where
we did potentially incorrect implicit conversions.
@AlexeySachkov AlexeySachkov requested a review from a team as a code owner June 3, 2025 13:47
@uditagarwal97
Copy link
Contributor

How about we add -Wconversion flag while building compiler in CI?
CC: @sarnex

@sarnex
Copy link
Contributor

sarnex commented Jun 3, 2025

Agree it's a good idea but who is gonna do it :)

@uditagarwal97
Copy link
Contributor

uditagarwal97 commented Jun 3, 2025

Agree it's a good idea but who is gonna do it :)

I'll file a ticket for now and can work on it when I get some free time.
Edit:- ticket: #18788

@AlexeySachkov AlexeySachkov merged commit 57cc5fe into intel:sycl Jun 6, 2025
24 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/fix-xpti-wconversion-warnings branch June 6, 2025 12:47
@frasercrmck
Copy link
Contributor

This appears to be causing compilation issues on my system:

/llvm/xpti/src/xpti_proxy.cpp:236:16: error: 'invalid_id' does not name a template but is followed by template arguments
  return xpti::invalid_id<uint16_t>;
               ^         ~~~~~~~~~~
/build/include/xpti/xpti_data_types.h:315:15: note: non-template declaration found by name lookup
constexpr int invalid_id = -1;
              ^

Is this a header inclusion order issue? That looks like the wrong invalid_id to find.

@frasercrmck
Copy link
Contributor

This appears to be causing compilation issues on my system:

/llvm/xpti/src/xpti_proxy.cpp:236:16: error: 'invalid_id' does not name a template but is followed by template arguments
  return xpti::invalid_id<uint16_t>;
               ^         ~~~~~~~~~~
/build/include/xpti/xpti_data_types.h:315:15: note: non-template declaration found by name lookup
constexpr int invalid_id = -1;
              ^

Is this a header inclusion order issue? That looks like the wrong invalid_id to find.

Interesting - I tried rebuilding several times and it eventually fixed itself. I suspect there's a missing build dependency on copying the headers to the build directory. It was probably including an old xpti/xpti_data_types.h.

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.

5 participants