[libc-commits] [libc] [libc] Fix some warnings. (PR #219252)

via libc-commits libc-commits at lists.llvm.org
Thu Aug 27 10:48:52 PDT 2026


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/219252

vla warnings in libc/src/unistd/linux/execle.cpp and constexpr warnings in libc/src/__support/math/lgammaf16.h

>From 29b9ec2df78b240eac33013e41adbe4a99ec60c2 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 27 Aug 2026 17:39:57 +0000
Subject: [PATCH] [libc] Fix some warnings.

---
 libc/src/__support/math/lgammaf16.h | 2 +-
 libc/src/unistd/linux/execle.cpp    | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/libc/src/__support/math/lgammaf16.h b/libc/src/__support/math/lgammaf16.h
index 34f2c2717f493..72d8a737faff9 100644
--- a/libc/src/__support/math/lgammaf16.h
+++ b/libc/src/__support/math/lgammaf16.h
@@ -48,7 +48,7 @@ LIBC_INLINE constexpr bool is_integer(float16 x) {
 // with max error ~2^{-55}, generated by Sollya with:
 //   > P = fpminimax(sin(pi*(x+0.5))/(pi*(0.25-x^2)),
 //                   [|0,2,4,6,8,10,12,14|], [|D...|], [-0.5, 0.5]);
-LIBC_INLINE constexpr double lg_sinpi(double x) {
+LIBC_INLINE double lg_sinpi(double x) {
   constexpr double COEFFS[8] = {0x000000000000001p+2,  -0x1.de9e64df22ea4p+1,
                                 0x1.472be122401f8p+0,  -0x1.d4fcd82df91bp-3,
                                 0x1.9f05c97e0aab2p-6,  -0x1.f3091c427b611p-10,
diff --git a/libc/src/unistd/linux/execle.cpp b/libc/src/unistd/linux/execle.cpp
index fae705abd98a2..c83a5670396b3 100644
--- a/libc/src/unistd/linux/execle.cpp
+++ b/libc/src/unistd/linux/execle.cpp
@@ -33,7 +33,13 @@ LLVM_LIBC_FUNCTION(int, execle, (const char *path, const char *arg0, ...)) {
     ++argc;
   va_end(varargs);
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wvla"
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wvla-cxx-extension"
+#endif
   char *argv[argc + 1];
+#pragma GCC diagnostic pop
   argv[0] = const_cast<char *>(arg0);
 
   for (size_t i = 1; i <= argc; ++i)



More information about the libc-commits mailing list