Skip to content

Commit 49cd4ba

Browse files
[SYCL RTC][NFC] Initialize StrLen variable (#20426)
This commit adds an initialization to the StrLen variable in the auto_pch_key read function. This should avoid a warnings - turning error in RHEL - about potentially uninitialized variables, despite it being set by readInteger. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 2f7b054 commit 49cd4ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct auto_pch_key {
117117
Error read(llvm::BinaryStreamReader &Reader) {
118118
(void)AutoPCHError::ID;
119119
auto ReadStr = [&](std::string &Out) -> Error {
120-
std::string::size_type StrLen;
120+
std::string::size_type StrLen = 0;
121121

122122
if (auto Err = Reader.readInteger(StrLen))
123123
return Err;

0 commit comments

Comments
 (0)