Skip to content

Commit f7f5aa2

Browse files
authored
[Clang][AMDGPU] Use size_t to compare with npos (llvm#132868)
Fix error llvm\clang\tools\amdgpu-arch\AMDGPUArchByHIP.cpp(102,29): error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] 102 | StringRef VerStr = (Pos == StringRef::npos) ? S : S.substr(Pos + 1);
1 parent 3bcbb47 commit f7f5aa2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/tools/amdgpu-arch/AMDGPUArchByHIP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static std::vector<std::string> getSearchPaths() {
9898
// Custom comparison function for dll name
9999
static bool compareVersions(StringRef A, StringRef B) {
100100
auto ParseVersion = [](StringRef S) -> VersionTuple {
101-
unsigned Pos = S.find_last_of('_');
101+
size_t Pos = S.find_last_of('_');
102102
StringRef VerStr = (Pos == StringRef::npos) ? S : S.substr(Pos + 1);
103103
VersionTuple Vt;
104104
(void)Vt.tryParse(VerStr);

0 commit comments

Comments
 (0)