Skip to content

Fix signed/unsigned mismatch warning #134255

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

Fix signed/unsigned mismatch warning #134255

merged 1 commit into from
Apr 3, 2025

Conversation

gbMattN
Copy link
Contributor

@gbMattN gbMattN commented Apr 3, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (gbMattN)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134255.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index fcac686b4cd10..9bd257c6e2639 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -3447,7 +3447,7 @@ static StringRef getAllocaName(AllocaInst *AI) {
       if (!isa<MDTuple>(Annotation))
         continue;
       auto AnnotationTuple = cast<MDTuple>(Annotation);
-      for (int Index = 0; Index < AnnotationTuple->getNumOperands(); Index++) {
+      for (unsigned Index = 0; Index < AnnotationTuple->getNumOperands(); Index++) {
         // All annotations are strings
         auto MetadataString =
             cast<MDString>(AnnotationTuple->getOperand(Index));

@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/pr-subscribers-llvm-transforms

Author: None (gbMattN)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134255.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index fcac686b4cd10..9bd257c6e2639 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -3447,7 +3447,7 @@ static StringRef getAllocaName(AllocaInst *AI) {
       if (!isa<MDTuple>(Annotation))
         continue;
       auto AnnotationTuple = cast<MDTuple>(Annotation);
-      for (int Index = 0; Index < AnnotationTuple->getNumOperands(); Index++) {
+      for (unsigned Index = 0; Index < AnnotationTuple->getNumOperands(); Index++) {
         // All annotations are strings
         auto MetadataString =
             cast<MDString>(AnnotationTuple->getOperand(Index));

Copy link

github-actions bot commented Apr 3, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@gbMattN gbMattN merged commit 61ef286 into llvm:main Apr 3, 2025
6 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants