[llvm] a50c7eb - [Support] Fix signed/unsigned comparison warning

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 03:26:23 PDT 2020


Author: Oliver Stannard
Date: 2020-07-08T11:26:10+01:00
New Revision: a50c7ebfd0f06982e8dc31020acae4d32e6d0e9f

URL: https://github.com/llvm/llvm-project/commit/a50c7ebfd0f06982e8dc31020acae4d32e6d0e9f
DIFF: https://github.com/llvm/llvm-project/commit/a50c7ebfd0f06982e8dc31020acae4d32e6d0e9f.diff

LOG: [Support] Fix signed/unsigned comparison warning

Added: 
    

Modified: 
    llvm/lib/Support/FormattedStream.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/FormattedStream.cpp b/llvm/lib/Support/FormattedStream.cpp
index 081b8bf2cc19..5716afc187e4 100644
--- a/llvm/lib/Support/FormattedStream.cpp
+++ b/llvm/lib/Support/FormattedStream.cpp
@@ -82,7 +82,7 @@ void formatted_raw_ostream::UpdatePosition(const char *Ptr, size_t Size) {
     // the display width until we see the rest of the code point. Stash the
     // bytes we do have, so that we can reconstruct the whole code point later,
     // even if the buffer is being flushed.
-    if ((End - Ptr) < NumBytes) {
+    if ((unsigned)(End - Ptr) < NumBytes) {
       PartialUTF8Char = StringRef(Ptr, End - Ptr);
       return;
     }


        


More information about the llvm-commits mailing list