[Openmp-commits] [openmp] ffca74b - [OpenMP] Fix sign comparison warnings from GCC
via Openmp-commits
openmp-commits at lists.llvm.org
Tue Feb 2 08:53:23 PST 2021
Author: Peyton, Jonathan L
Date: 2021-02-02T10:52:16-06:00
New Revision: ffca74b8b82f0af0d213bffa59c40b10449fd05f
URL: https://github.com/llvm/llvm-project/commit/ffca74b8b82f0af0d213bffa59c40b10449fd05f
DIFF: https://github.com/llvm/llvm-project/commit/ffca74b8b82f0af0d213bffa59c40b10449fd05f.diff
LOG: [OpenMP] Fix sign comparison warnings from GCC
New affinity patch introduced legitimate sign-compare warnings that
clang doesn't report but GCC-10 does. This removes the warnings by
changing two variables types to unsigned.
Differential Revision: https://reviews.llvm.org/D95818
Added:
Modified:
openmp/runtime/src/kmp_affinity.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index 0161aca726f0..a94dbd1e0c35 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -109,8 +109,8 @@ static int __kmp_affinity_remove_radix_one_levels(AddrUnsPair *addrP, int nTh,
}
bool radix1 = true;
bool all_same = true;
- int id1 = addrP[0].first.labels[top_index1];
- int id2 = addrP[0].first.labels[top_index2];
+ unsigned id1 = addrP[0].first.labels[top_index1];
+ unsigned id2 = addrP[0].first.labels[top_index2];
int pref1 = preference[type1];
int pref2 = preference[type2];
for (int hwidx = 1; hwidx < nTh; ++hwidx) {
More information about the Openmp-commits
mailing list