Skip to content

Commit 3c81533

Browse files
authored
Fixing bool->iree_status_t cast error. (#21212)
My local compiler caught this for some reason but IIRC people do this badness in LLVM/C++ and we haven't been able to turn it on. More reason to split the cmake macros for compiler/runtime code so we can at least enable `-Werror,-Wbool-conversion` in the runtime (it is never valid). ``` [build] /home/ben/src/iree/runtime/src/iree/base/internal/wait_handle_poll.c:385:33: error: initialization of pointer of type 'iree_status_t' (aka 'struct iree_status_handle_t *') to null from a constant boolean expression [-Werror,-Wbool-conversion] [build] 385 | if (poll_fds.fd == -1) return false; [build] | ^~~~~ ```
1 parent 57d6172 commit 3c81533

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/src/iree/base/internal/wait_handle_poll.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ iree_status_t iree_wait_one(iree_wait_handle_t* handle,
382382
iree_time_t deadline_ns) {
383383
struct pollfd poll_fds;
384384
poll_fds.fd = iree_wait_primitive_get_read_fd(handle);
385-
if (poll_fds.fd == -1) return false;
385+
if (poll_fds.fd == -1) {
386+
return iree_ok_status(); // no-op wait
387+
}
386388
poll_fds.events = POLLIN;
387389
poll_fds.revents = 0;
388390

0 commit comments

Comments
 (0)