[libc-commits] [libc] [libc] Add braces around empty body in pipe2 wrapper (PR #234723)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Thu Oct 22 11:59:28 PDT 2026


https://github.com/kaladron created https://github.com/llvm/llvm-project/pull/234723

GCC warns with -Wempty-body when LIBC_MSAN_UNPOISON expands to an empty body inside an unbraced if statement. Enclose the macro invocation in braces to resolve the buildbot compilation failure.

Assisted-by: Automated tooling, human reviewed.

>From 9e02a734db82887557fd8dfb519e1cf33ea3063f Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Thu, 22 Oct 2026 19:49:12 +0100
Subject: [PATCH] [libc] Add braces around empty body in pipe2 wrapper

GCC warns with -Wempty-body when LIBC_MSAN_UNPOISON expands to an empty
body inside an unbraced if statement. Enclose the macro invocation in
braces to resolve the buildbot compilation failure.

Assisted-by: Automated tooling, human reviewed.
---
 libc/src/__support/OSUtil/linux/syscall_wrappers/pipe2.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libc/src/__support/OSUtil/linux/syscall_wrappers/pipe2.h b/libc/src/__support/OSUtil/linux/syscall_wrappers/pipe2.h
index dec98c869fcb23..8187f0022850b0 100644
--- a/libc/src/__support/OSUtil/linux/syscall_wrappers/pipe2.h
+++ b/libc/src/__support/OSUtil/linux/syscall_wrappers/pipe2.h
@@ -26,8 +26,9 @@ namespace linux_syscalls {
 
 LIBC_INLINE ErrorOr<int> pipe2(int pipefd[2], int flags) {
   ErrorOr<int> result = syscall_checked<int>(SYS_pipe2, pipefd, flags);
-  if (result.has_value())
+  if (result.has_value()) {
     LIBC_MSAN_UNPOISON(pipefd, sizeof(int) * 2);
+  }
   return result;
 }
 



More information about the libc-commits mailing list