Skip to content

Commit c2c6baf

Browse files
[SYCL] Fix constexpr string size in mock plugin (#6866)
#6852 incidentally used a non-constexpr solution for determining the size of a string, which causes failures in select build configurations. This commit amends this by using sizeof on a static array of characters instead of std::strlen. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 04c54fb commit c2c6baf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/unittests/helpers/PiMockPlugin.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ inline pi_result mock_piPlatformGetInfo(pi_platform platform,
4949
return PI_SUCCESS;
5050
}
5151
default: {
52-
constexpr const char *FallbackValue = "str";
53-
constexpr size_t FallbackValueSize = std::strlen(FallbackValue) + 1;
52+
constexpr const char FallbackValue[] = "str";
53+
constexpr size_t FallbackValueSize = sizeof(FallbackValue);
5454
if (param_value_size_ret)
5555
*param_value_size_ret = FallbackValueSize;
5656

0 commit comments

Comments
 (0)