[llvm] [Support] Remove an unnecessary cast (NFC) (PR #151083)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 28 22:33:20 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

NumRead is already of ssize_t.


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


1 Files Affected:

- (modified) llvm/lib/Support/Unix/Path.inc (+1-1) 


``````````diff
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 277247e3cc236..cc02cae40ec76 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -1190,7 +1190,7 @@ Expected<size_t> readNativeFile(file_t FD, MutableArrayRef<char> Buf) {
   size_t Size = Buf.size();
 #endif
   ssize_t NumRead = sys::RetryAfterSignal(-1, ::read, FD, Buf.data(), Size);
-  if (ssize_t(NumRead) == -1)
+  if (NumRead == -1)
     return errorCodeToError(errnoAsErrorCode());
 // The underlying operation on these platforms allow opening directories
 // for reading in more cases than other platforms.

``````````

</details>


https://github.com/llvm/llvm-project/pull/151083


More information about the llvm-commits mailing list