From 1f24901c0c54d9b95e3859d2d8e658042e0769ff Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 14 Sep 2026 12:41:55 +0000 Subject: [PATCH] src: fix `-Wextra` warning in `WriteFileSync` `req.result` is `ssize_t` while `UV_EIO` is an enumerator, which GCC flags as mixing enumerated and non-enumerated types in a conditional expression. Assisted-by: Devin Signed-off-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/66020 Reviewed-By: Xuguang Mei Reviewed-By: James M Snell Reviewed-By: Chengzhong Wu --- src/node_file_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_file_utils.cc b/src/node_file_utils.cc index ced08b1d0ff..6c62fcee55a 100644 --- a/src/node_file_utils.cc +++ b/src/node_file_utils.cc @@ -59,7 +59,7 @@ int WriteFileSync(const char* path, uv_buf_t* bufs, size_t buf_count) { nullptr); if (req.result <= 0) { // Error during write. // UV_EIO should not happen unless the file system is full. - int err = req.result < 0 ? req.result : UV_EIO; + int err = req.result < 0 ? static_cast(req.result) : UV_EIO; uv_fs_req_cleanup(&req); uv_fs_close(nullptr, &req, fd, nullptr); uv_fs_req_cleanup(&req);