[PATCH] D154275: [llvm-exegesis] Support older kernel versions in subprocess executor

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 23:44:57 PDT 2023


aidengrossman added inline comments.


================
Comment at: llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp:224
+
+    size_t BytesRead = recvmsg(SocketFD, &Message, 0);
+
----------------
uabelho wrote:
> Should be ssize_t ?
> 
> The
> ```
>  BytesRead < 0
> ```
> check below is currently always false since size_t is unsigned.
> 
> I noticed this when I compiled with gcc which warned 
> 
> ```
> ../tools/llvm-exegesis/lib/BenchmarkRunner.cpp:226:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>   226 |     if (BytesRead < 0)
>       |         ~~~~~~~~~~^~~
> ```
Yep. Thanks for pointing this out! Not sure how I missed it. `recvmsg` definitely returns ` ssize_t`.

Fixed in 34e3bc0b92d7fdc59477c93d187546a2566fbc22.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154275/new/

https://reviews.llvm.org/D154275



More information about the llvm-commits mailing list