[llvm-branch-commits] [libc] 75c7e19 - Revert "[libc] Add -Wextra for libc tests (#133643)"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 12 04:34:53 PDT 2025


Author: William Huynh
Date: 2025-08-12T12:34:51+01:00
New Revision: 75c7e19456a30e054c93b9c6d7b4dec19830ee3a

URL: https://github.com/llvm/llvm-project/commit/75c7e19456a30e054c93b9c6d7b4dec19830ee3a
DIFF: https://github.com/llvm/llvm-project/commit/75c7e19456a30e054c93b9c6d7b4dec19830ee3a.diff

LOG: Revert "[libc] Add -Wextra for libc tests (#133643)"

This reverts commit e617dc80bf9376ca948ee7af8304ea00b2263b51.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake
    libc/test/UnitTest/FPExceptMatcher.cpp
    libc/test/UnitTest/FPExceptMatcher.h
    libc/test/UnitTest/HermeticTestUtils.cpp
    libc/test/UnitTest/LibcDeathTestExecutors.cpp
    libc/test/UnitTest/LibcTest.h
    libc/test/include/stdbit_stub.h
    libc/test/integration/src/pthread/pthread_mutex_test.cpp
    libc/test/integration/src/spawn/posix_spawn_test.cpp
    libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
    libc/test/integration/src/stdio/sprintf_size_test.cpp
    libc/test/integration/src/stdlib/getenv_test.cpp
    libc/test/integration/src/threads/cnd_test.cpp
    libc/test/integration/src/threads/mtx_test.cpp
    libc/test/integration/src/unistd/execv_test.cpp
    libc/test/integration/src/unistd/execve_test.cpp
    libc/test/integration/src/unistd/fork_test.cpp
    libc/test/integration/src/unistd/getcwd_test.cpp
    libc/test/integration/startup/linux/main_without_envp.cpp
    libc/test/integration/startup/linux/tls_test.cpp
    libc/test/src/__support/CPP/integer_sequence_test.cpp
    libc/test/src/__support/freelist_heap_test.cpp
    libc/test/src/math/exhaustive/hypotf16_test.cpp
    libc/test/src/stdlib/StrfromTest.h
    libc/test/src/string/memory_utils/op_tests.cpp
    libc/test/src/strings/bzero_test.cpp
    libc/utils/MPFRWrapper/MPFRUtils.h

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 44cc6a35df886..30b1fd10a1774 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -40,7 +40,7 @@ function(_get_common_test_compile_options output_var c_test flags)
     endif()
 
     # list(APPEND compile_options "-Wall")
-    list(APPEND compile_options "-Wextra")
+    # list(APPEND compile_options "-Wextra")
     # -DLIBC_WNO_ERROR=ON if you can't build cleanly with -Werror.
     if(NOT LIBC_WNO_ERROR)
       # list(APPEND compile_options "-Werror")

diff  --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index 9688d53496f94..d66066023984e 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -31,7 +31,7 @@ namespace testing {
 static thread_local sigjmp_buf jumpBuffer;
 static thread_local bool caughtExcept;
 
-static void sigfpeHandler([[maybe_unused]] int sig) {
+static void sigfpeHandler(int sig) {
   caughtExcept = true;
   siglongjmp(jumpBuffer, -1);
 }

diff  --git a/libc/test/UnitTest/FPExceptMatcher.h b/libc/test/UnitTest/FPExceptMatcher.h
index 9b05e83bc1e3a..978501df7e3ed 100644
--- a/libc/test/UnitTest/FPExceptMatcher.h
+++ b/libc/test/UnitTest/FPExceptMatcher.h
@@ -43,7 +43,7 @@ class FPExceptMatcher : public Matcher<bool> {
   // Takes ownership of func.
   explicit FPExceptMatcher(FunctionCaller *func);
 
-  bool match([[maybe_unused]] bool unused) { return exceptionRaised; }
+  bool match(bool unused) { return exceptionRaised; }
 
   void explainError() override {
     tlog << "A floating point exception should have been raised but it "

diff  --git a/libc/test/UnitTest/HermeticTestUtils.cpp b/libc/test/UnitTest/HermeticTestUtils.cpp
index 3c82d1e963643..f34a73f3e6805 100644
--- a/libc/test/UnitTest/HermeticTestUtils.cpp
+++ b/libc/test/UnitTest/HermeticTestUtils.cpp
@@ -29,9 +29,7 @@ int atexit(void (*func)(void));
 // add_libc_hermetic_test properly. Such that they won't get correct linkage
 // against the object containing this function. We create a dummy function that
 // always returns 0 to indicate a failure.
-[[gnu::weak]] unsigned long getauxval([[maybe_unused]] unsigned long id) {
-  return 0;
-}
+[[gnu::weak]] unsigned long getauxval(unsigned long id) { return 0; }
 
 } // namespace LIBC_NAMESPACE_DECL
 
@@ -126,7 +124,7 @@ unsigned long __getauxval(unsigned long id) {
 
 } // extern "C"
 
-void *operator new([[maybe_unused]] size_t size, void *ptr) { return ptr; }
+void *operator new(size_t size, void *ptr) { return ptr; }
 
 void *operator new(size_t size) { return malloc(size); }
 
@@ -138,9 +136,7 @@ void operator delete(void *) {
   __builtin_trap();
 }
 
-void operator delete([[maybe_unused]] void *ptr, [[maybe_unused]] size_t size) {
-  __builtin_trap();
-}
+void operator delete(void *ptr, size_t size) { __builtin_trap(); }
 
 // Defining members in the std namespace is not preferred. But, we do it here
 // so that we can use it to define the operator new which takes std::align_val_t
@@ -149,11 +145,8 @@ namespace std {
 enum class align_val_t : size_t {};
 } // namespace std
 
-void operator delete([[maybe_unused]] void *mem, std::align_val_t) noexcept {
-  __builtin_trap();
-}
+void operator delete(void *mem, std::align_val_t) noexcept { __builtin_trap(); }
 
-void operator delete([[maybe_unused]] void *mem, unsigned int,
-                     std::align_val_t) noexcept {
+void operator delete(void *mem, unsigned int, std::align_val_t) noexcept {
   __builtin_trap();
 }

diff  --git a/libc/test/UnitTest/LibcDeathTestExecutors.cpp b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
index 5f8d7b86a5187..943e2c23c5fde 100644
--- a/libc/test/UnitTest/LibcDeathTestExecutors.cpp
+++ b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
@@ -22,8 +22,7 @@ namespace LIBC_NAMESPACE_DECL {
 namespace testing {
 
 bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
-                             const char *LHSStr,
-                             [[maybe_unused]] const char *RHSStr,
+                             const char *LHSStr, const char *RHSStr,
                              internal::Location Loc) {
   testutils::ProcessStatus Result =
       testutils::invoke_in_subprocess(Func, TIMEOUT_MS);

diff  --git a/libc/test/UnitTest/LibcTest.h b/libc/test/UnitTest/LibcTest.h
index 5762b49b6066b..fbeafd0bacb75 100644
--- a/libc/test/UnitTest/LibcTest.h
+++ b/libc/test/UnitTest/LibcTest.h
@@ -81,7 +81,7 @@ struct Message {
 // A trivial object to catch the Message, this enables custom logging and
 // returning from the test function, see LIBC_TEST_SCAFFOLDING_ below.
 struct Failure {
-  void operator=([[maybe_unused]] Message msg) {}
+  void operator=(Message msg) {}
 };
 
 struct RunContext {

diff  --git a/libc/test/include/stdbit_stub.h b/libc/test/include/stdbit_stub.h
index e08c86271332e..3d2e0fb60334e 100644
--- a/libc/test/include/stdbit_stub.h
+++ b/libc/test/include/stdbit_stub.h
@@ -17,21 +17,11 @@
 #include <stdbool.h> // bool in C
 
 #define STDBIT_STUB_FUNCTION(FUNC_NAME, LEADING_VAL)                           \
-  unsigned FUNC_NAME##_uc([[maybe_unused]] unsigned char x) {                  \
-    return LEADING_VAL##AU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_us([[maybe_unused]] unsigned short x) {                 \
-    return LEADING_VAL##BU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ui([[maybe_unused]] unsigned int x) {                   \
-    return LEADING_VAL##CU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ul([[maybe_unused]] unsigned long x) {                  \
-    return LEADING_VAL##DU;                                                    \
-  }                                                                            \
-  unsigned FUNC_NAME##_ull([[maybe_unused]] unsigned long long x) {            \
-    return LEADING_VAL##EU;                                                    \
-  }
+  unsigned FUNC_NAME##_uc(unsigned char x) { return LEADING_VAL##AU; }         \
+  unsigned FUNC_NAME##_us(unsigned short x) { return LEADING_VAL##BU; }        \
+  unsigned FUNC_NAME##_ui(unsigned int x) { return LEADING_VAL##CU; }          \
+  unsigned FUNC_NAME##_ul(unsigned long x) { return LEADING_VAL##DU; }         \
+  unsigned FUNC_NAME##_ull(unsigned long long x) { return LEADING_VAL##EU; }
 
 __BEGIN_C_DECLS
 
@@ -46,42 +36,24 @@ STDBIT_STUB_FUNCTION(stdc_first_trailing_one, 0x1)
 STDBIT_STUB_FUNCTION(stdc_count_zeros, 0x2)
 STDBIT_STUB_FUNCTION(stdc_count_ones, 0x3)
 
-bool stdc_has_single_bit_uc([[maybe_unused]] unsigned char x) { return false; }
-bool stdc_has_single_bit_us([[maybe_unused]] unsigned short x) { return false; }
-bool stdc_has_single_bit_ui([[maybe_unused]] unsigned x) { return false; }
-bool stdc_has_single_bit_ul([[maybe_unused]] unsigned long x) { return false; }
-bool stdc_has_single_bit_ull([[maybe_unused]] unsigned long long x) {
-  return false;
-}
+bool stdc_has_single_bit_uc(unsigned char x) { return false; }
+bool stdc_has_single_bit_us(unsigned short x) { return false; }
+bool stdc_has_single_bit_ui(unsigned x) { return false; }
+bool stdc_has_single_bit_ul(unsigned long x) { return false; }
+bool stdc_has_single_bit_ull(unsigned long long x) { return false; }
 
 STDBIT_STUB_FUNCTION(stdc_bit_width, 0x4)
 
-unsigned char stdc_bit_floor_uc([[maybe_unused]] unsigned char x) {
-  return 0x5AU;
-}
-unsigned short stdc_bit_floor_us([[maybe_unused]] unsigned short x) {
-  return 0x5BU;
-}
-unsigned stdc_bit_floor_ui([[maybe_unused]] unsigned x) { return 0x5CU; }
-unsigned long stdc_bit_floor_ul([[maybe_unused]] unsigned long x) {
-  return 0x5DUL;
-}
-unsigned long long stdc_bit_floor_ull([[maybe_unused]] unsigned long long x) {
-  return 0x5EULL;
-}
-
-unsigned char stdc_bit_ceil_uc([[maybe_unused]] unsigned char x) {
-  return 0x6AU;
-}
-unsigned short stdc_bit_ceil_us([[maybe_unused]] unsigned short x) {
-  return 0x6BU;
-}
-unsigned stdc_bit_ceil_ui([[maybe_unused]] unsigned x) { return 0x6CU; }
-unsigned long stdc_bit_ceil_ul([[maybe_unused]] unsigned long x) {
-  return 0x6DUL;
-}
-unsigned long long stdc_bit_ceil_ull([[maybe_unused]] unsigned long long x) {
-  return 0x6EULL;
-}
+unsigned char stdc_bit_floor_uc(unsigned char x) { return 0x5AU; }
+unsigned short stdc_bit_floor_us(unsigned short x) { return 0x5BU; }
+unsigned stdc_bit_floor_ui(unsigned x) { return 0x5CU; }
+unsigned long stdc_bit_floor_ul(unsigned long x) { return 0x5DUL; }
+unsigned long long stdc_bit_floor_ull(unsigned long long x) { return 0x5EULL; }
+
+unsigned char stdc_bit_ceil_uc(unsigned char x) { return 0x6AU; }
+unsigned short stdc_bit_ceil_us(unsigned short x) { return 0x6BU; }
+unsigned stdc_bit_ceil_ui(unsigned x) { return 0x6CU; }
+unsigned long stdc_bit_ceil_ul(unsigned long x) { return 0x6DUL; }
+unsigned long long stdc_bit_ceil_ull(unsigned long long x) { return 0x6EULL; }
 
 __END_C_DECLS

diff  --git a/libc/test/integration/src/pthread/pthread_mutex_test.cpp b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
index d482dcc13f443..d41ad6daf426d 100644
--- a/libc/test/integration/src/pthread/pthread_mutex_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
@@ -23,7 +23,7 @@ constexpr int MAX = 10000;
 pthread_mutex_t mutex;
 static int shared_int = START;
 
-void *counter([[maybe_unused]] void *arg) {
+void *counter(void *arg) {
   int last_count = START;
   while (true) {
     LIBC_NAMESPACE::pthread_mutex_lock(&mutex);
@@ -72,7 +72,7 @@ void relay_counter() {
 pthread_mutex_t start_lock, step_lock;
 bool started, step;
 
-void *stepper([[maybe_unused]] void *arg) {
+void *stepper(void *arg) {
   LIBC_NAMESPACE::pthread_mutex_lock(&start_lock);
   started = true;
   LIBC_NAMESPACE::pthread_mutex_unlock(&start_lock);

diff  --git a/libc/test/integration/src/spawn/posix_spawn_test.cpp b/libc/test/integration/src/spawn/posix_spawn_test.cpp
index 9e10ef1d5ec15..3c8cc7317b537 100644
--- a/libc/test/integration/src/spawn/posix_spawn_test.cpp
+++ b/libc/test/integration/src/spawn/posix_spawn_test.cpp
@@ -45,8 +45,7 @@ void spawn_and_wait_for_normal_exit(char **envp) {
   ASSERT_EQ(exit_status, 0);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   spawn_and_wait_for_normal_exit(envp);
   return 0;
 }

diff  --git a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
index f25337affaf16..c1b0cd671da71 100644
--- a/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
+++ b/libc/test/integration/src/spawn/posix_spawn_test_binary.cpp
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int main(int argc, [[maybe_unused]] char **argv) {
+int main(int argc, char **argv) {
   if (argc != 1)
     return 5;
   constexpr size_t bufsize = sizeof(TEXT);

diff  --git a/libc/test/integration/src/stdio/sprintf_size_test.cpp b/libc/test/integration/src/stdio/sprintf_size_test.cpp
index ac1f085d330dc..833159436d49c 100644
--- a/libc/test/integration/src/stdio/sprintf_size_test.cpp
+++ b/libc/test/integration/src/stdio/sprintf_size_test.cpp
@@ -38,7 +38,7 @@ static int my_strlen(const char *str) {
   return static_cast<int>(other - str);
 }
 
-TEST_MAIN(int argc, char **argv, [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_EQ(argc, 5);
   ASSERT_TRUE(my_streq(argv[1], "%s %c %d"));
   ASSERT_EQ(my_strlen(argv[1]), 8);

diff  --git a/libc/test/integration/src/stdlib/getenv_test.cpp b/libc/test/integration/src/stdlib/getenv_test.cpp
index 72dcea0ddf1f1..82a9b89533d2e 100644
--- a/libc/test/integration/src/stdlib/getenv_test.cpp
+++ b/libc/test/integration/src/stdlib/getenv_test.cpp
@@ -27,8 +27,7 @@ static bool my_streq(const char *lhs, const char *rhs) {
   return *l == '\0' && *r == '\0';
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_TRUE(
       my_streq(LIBC_NAMESPACE::getenv(""), static_cast<char *>(nullptr)));
   ASSERT_TRUE(

diff  --git a/libc/test/integration/src/threads/cnd_test.cpp b/libc/test/integration/src/threads/cnd_test.cpp
index 4eaab9ac08bc1..8791c6adbaa69 100644
--- a/libc/test/integration/src/threads/cnd_test.cpp
+++ b/libc/test/integration/src/threads/cnd_test.cpp
@@ -100,7 +100,7 @@ namespace single_waiter_test {
 mtx_t waiter_mtx, main_thread_mtx;
 cnd_t waiter_cnd, main_thread_cnd;
 
-int waiter_thread_func([[maybe_unused]] void *unused) {
+int waiter_thread_func(void *unused) {
   LIBC_NAMESPACE::mtx_lock(&waiter_mtx);
 
   LIBC_NAMESPACE::mtx_lock(&main_thread_mtx);

diff  --git a/libc/test/integration/src/threads/mtx_test.cpp b/libc/test/integration/src/threads/mtx_test.cpp
index 0b0a9faae24a6..82b0350af97af 100644
--- a/libc/test/integration/src/threads/mtx_test.cpp
+++ b/libc/test/integration/src/threads/mtx_test.cpp
@@ -23,7 +23,7 @@ constexpr int MAX = 10000;
 mtx_t mutex;
 static int shared_int = START;
 
-int counter([[maybe_unused]] void *arg) {
+int counter(void *arg) {
   int last_count = START;
   while (true) {
     LIBC_NAMESPACE::mtx_lock(&mutex);
@@ -74,7 +74,7 @@ void relay_counter() {
 mtx_t start_lock, step_lock;
 bool started, step;
 
-int stepper([[maybe_unused]] void *arg) {
+int stepper(void *arg) {
   LIBC_NAMESPACE::mtx_lock(&start_lock);
   started = true;
   LIBC_NAMESPACE::mtx_unlock(&start_lock);

diff  --git a/libc/test/integration/src/unistd/execv_test.cpp b/libc/test/integration/src/unistd/execv_test.cpp
index bdd54d420760c..254ef955f2720 100644
--- a/libc/test/integration/src/unistd/execv_test.cpp
+++ b/libc/test/integration/src/unistd/execv_test.cpp
@@ -52,8 +52,7 @@ void fork_and_execv_signal_exit() {
   ASSERT_TRUE(WTERMSIG(status) == SIGUSR1);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   fork_and_execv_normal_exit();
   fork_and_execv_signal_exit();
   return 0;

diff  --git a/libc/test/integration/src/unistd/execve_test.cpp b/libc/test/integration/src/unistd/execve_test.cpp
index 1204de3984c7e..fb1a83da63856 100644
--- a/libc/test/integration/src/unistd/execve_test.cpp
+++ b/libc/test/integration/src/unistd/execve_test.cpp
@@ -52,8 +52,7 @@ void fork_and_execv_signal_exit(char **envp) {
   ASSERT_TRUE(WTERMSIG(status) == SIGUSR1);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   fork_and_execv_normal_exit(envp);
   fork_and_execv_signal_exit(envp);
   return 0;

diff  --git a/libc/test/integration/src/unistd/fork_test.cpp b/libc/test/integration/src/unistd/fork_test.cpp
index 7eeefa4477806..010f57a7d2448 100644
--- a/libc/test/integration/src/unistd/fork_test.cpp
+++ b/libc/test/integration/src/unistd/fork_test.cpp
@@ -159,8 +159,7 @@ void gettid_test() {
   ASSERT_EQ(WEXITSTATUS(status), 0);
 }
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   gettid_test();
   fork_and_wait_normal_exit();
   fork_and_wait4_normal_exit();

diff  --git a/libc/test/integration/src/unistd/getcwd_test.cpp b/libc/test/integration/src/unistd/getcwd_test.cpp
index 5e5c0fa83a3cb..1b321b01e9315 100644
--- a/libc/test/integration/src/unistd/getcwd_test.cpp
+++ b/libc/test/integration/src/unistd/getcwd_test.cpp
@@ -17,8 +17,7 @@
 
 using LIBC_NAMESPACE::cpp::string_view;
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   char buffer[1024];
   ASSERT_TRUE(string_view(LIBC_NAMESPACE::getenv("PWD")) ==
               LIBC_NAMESPACE::getcwd(buffer, 1024));

diff  --git a/libc/test/integration/startup/linux/main_without_envp.cpp b/libc/test/integration/startup/linux/main_without_envp.cpp
index 894f43083faee..d2c24f4bd9f14 100644
--- a/libc/test/integration/startup/linux/main_without_envp.cpp
+++ b/libc/test/integration/startup/linux/main_without_envp.cpp
@@ -8,4 +8,4 @@
 
 #include "test/IntegrationTest/test.h"
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv) { return 0; }
+TEST_MAIN(int argc, char **argv) { return 0; }

diff  --git a/libc/test/integration/startup/linux/tls_test.cpp b/libc/test/integration/startup/linux/tls_test.cpp
index 097c8cd0967d9..de3bd06c39cf6 100644
--- a/libc/test/integration/startup/linux/tls_test.cpp
+++ b/libc/test/integration/startup/linux/tls_test.cpp
@@ -15,8 +15,7 @@
 constexpr int threadLocalDataSize = 101;
 _Thread_local int a[threadLocalDataSize] = {123};
 
-TEST_MAIN([[maybe_unused]] int argc, [[maybe_unused]] char **argv,
-          [[maybe_unused]] char **envp) {
+TEST_MAIN(int argc, char **argv, char **envp) {
   ASSERT_TRUE(a[0] == 123);
 
   for (int i = 1; i < threadLocalDataSize; ++i)

diff  --git a/libc/test/src/__support/CPP/integer_sequence_test.cpp b/libc/test/src/__support/CPP/integer_sequence_test.cpp
index 590fb4ede4cda..fe378522b446b 100644
--- a/libc/test/src/__support/CPP/integer_sequence_test.cpp
+++ b/libc/test/src/__support/CPP/integer_sequence_test.cpp
@@ -23,8 +23,7 @@ TEST(LlvmLibcIntegerSequencetTest, Basic) {
       (is_same_v<ULLSeq, make_integer_sequence<unsigned long long, 4>>));
 }
 
-template <typename T, T... Ts>
-bool checkArray([[maybe_unused]] integer_sequence<T, Ts...> seq) {
+template <typename T, T... Ts> bool checkArray(integer_sequence<T, Ts...> seq) {
   T arr[sizeof...(Ts)]{Ts...};
 
   for (T i = 0; i < static_cast<T>(sizeof...(Ts)); i++)

diff  --git a/libc/test/src/__support/freelist_heap_test.cpp b/libc/test/src/__support/freelist_heap_test.cpp
index ea7310d1d0756..93e23619661a0 100644
--- a/libc/test/src/__support/freelist_heap_test.cpp
+++ b/libc/test/src/__support/freelist_heap_test.cpp
@@ -57,7 +57,7 @@ using LIBC_NAMESPACE::cpp::span;
     RunTest(*freelist_heap, freelist_heap->region().size());                   \
   }                                                                            \
   void LlvmLibcFreeListHeapTest##TestCase::RunTest(FreeListHeap &allocator,    \
-                                                   [[maybe_unused]] size_t N)
+                                                   size_t N)
 
 TEST_FOR_EACH_ALLOCATOR(CanAllocate, 2048) {
   constexpr size_t ALLOC_SIZE = 512;

diff  --git a/libc/test/src/math/exhaustive/hypotf16_test.cpp b/libc/test/src/math/exhaustive/hypotf16_test.cpp
index a822fc433d170..f79041e6dbd77 100644
--- a/libc/test/src/math/exhaustive/hypotf16_test.cpp
+++ b/libc/test/src/math/exhaustive/hypotf16_test.cpp
@@ -20,9 +20,8 @@ struct Hypotf16Checker : public virtual LIBC_NAMESPACE::testing::Test {
   using FPBits = LIBC_NAMESPACE::fputil::FPBits<float16>;
   using StorageType = typename FPBits::StorageType;
 
-  uint64_t check(uint16_t x_start, uint16_t x_stop,
-                 [[maybe_unused]] uint16_t y_start, uint16_t y_stop,
-                 mpfr::RoundingMode rounding) {
+  uint64_t check(uint16_t x_start, uint16_t x_stop, uint16_t y_start,
+                 uint16_t y_stop, mpfr::RoundingMode rounding) {
     mpfr::ForceRoundingMode r(rounding);
     if (!r.success)
       return true;

diff  --git a/libc/test/src/stdlib/StrfromTest.h b/libc/test/src/stdlib/StrfromTest.h
index e82c94499aa11..197165c68d587 100644
--- a/libc/test/src/stdlib/StrfromTest.h
+++ b/libc/test/src/stdlib/StrfromTest.h
@@ -357,7 +357,7 @@ class StrfromTest : public LIBC_NAMESPACE::testing::Test {
     ASSERT_STREQ_LEN(written, buff, "1.0e+01");
   }
 
-  void floatDecimalExpLongDoublePrec([[maybe_unused]] FunctionT func) {
+  void floatDecimalExpLongDoublePrec(FunctionT func) {
     // Mark as maybe_unused to silence unused variable
     // warning when long double is not 80-bit
     [[maybe_unused]] char buff[100];
@@ -422,7 +422,7 @@ class StrfromTest : public LIBC_NAMESPACE::testing::Test {
     ASSERT_STREQ_LEN(written, buff, "1.2340000000000000814e-10");
   }
 
-  void floatDecimalAutoLongDoublePrec([[maybe_unused]] FunctionT func) {
+  void floatDecimalAutoLongDoublePrec(FunctionT func) {
     // Mark as maybe_unused to silence unused variable
     // warning when long double is not 80-bit
     [[maybe_unused]] char buff[100];

diff  --git a/libc/test/src/string/memory_utils/op_tests.cpp b/libc/test/src/string/memory_utils/op_tests.cpp
index 06089a89d9aac..2057ab3eaaded 100644
--- a/libc/test/src/string/memory_utils/op_tests.cpp
+++ b/libc/test/src/string/memory_utils/op_tests.cpp
@@ -72,8 +72,7 @@ void CopyAdaptor(cpp::span<char> dst, cpp::span<char> src, size_t size) {
   FnImpl(as_byte(dst), as_byte(src), size);
 }
 template <size_t Size, auto FnImpl>
-void CopyBlockAdaptor(cpp::span<char> dst, cpp::span<char> src,
-                      [[maybe_unused]] size_t size) {
+void CopyBlockAdaptor(cpp::span<char> dst, cpp::span<char> src, size_t size) {
   FnImpl(as_byte(dst), as_byte(src));
 }
 
@@ -154,8 +153,7 @@ void SetAdaptor(cpp::span<char> dst, uint8_t value, size_t size) {
   FnImpl(as_byte(dst), value, size);
 }
 template <size_t Size, auto FnImpl>
-void SetBlockAdaptor(cpp::span<char> dst, uint8_t value,
-                     [[maybe_unused]] size_t size) {
+void SetBlockAdaptor(cpp::span<char> dst, uint8_t value, size_t size) {
   FnImpl(as_byte(dst), value);
 }
 
@@ -244,8 +242,7 @@ int CmpAdaptor(cpp::span<char> p1, cpp::span<char> p2, size_t size) {
   return (int)FnImpl(as_byte(p1), as_byte(p2), size);
 }
 template <size_t Size, auto FnImpl>
-int CmpBlockAdaptor(cpp::span<char> p1, cpp::span<char> p2,
-                    [[maybe_unused]] size_t size) {
+int CmpBlockAdaptor(cpp::span<char> p1, cpp::span<char> p2, size_t size) {
   return (int)FnImpl(as_byte(p1), as_byte(p2));
 }
 

diff  --git a/libc/test/src/strings/bzero_test.cpp b/libc/test/src/strings/bzero_test.cpp
index a09d711bcb2e6..4d4112f4be8ee 100644
--- a/libc/test/src/strings/bzero_test.cpp
+++ b/libc/test/src/strings/bzero_test.cpp
@@ -14,8 +14,7 @@
 namespace LIBC_NAMESPACE_DECL {
 
 // Adapt CheckMemset signature to bzero.
-static inline void Adaptor(cpp::span<char> p1, [[maybe_unused]] uint8_t value,
-                           size_t size) {
+static inline void Adaptor(cpp::span<char> p1, uint8_t value, size_t size) {
   LIBC_NAMESPACE::bzero(p1.begin(), size);
 }
 

diff  --git a/libc/utils/MPFRWrapper/MPFRUtils.h b/libc/utils/MPFRWrapper/MPFRUtils.h
index d7b5582203fa5..45468c6cb19ae 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.h
+++ b/libc/utils/MPFRWrapper/MPFRUtils.h
@@ -352,7 +352,7 @@ template <Operation op, typename InputType, typename OutputType>
 __attribute__((no_sanitize("address"))) cpp::enable_if_t<
     is_valid_operation<op, InputType, OutputType>(),
     internal::MPFRMatcher<op, /*is_silent*/ false, InputType, OutputType>>
-get_mpfr_matcher(InputType input, [[maybe_unused]] OutputType output_unused,
+get_mpfr_matcher(InputType input, OutputType output_unused,
                  double ulp_tolerance, RoundingMode rounding) {
   return internal::MPFRMatcher<op, /*is_silent*/ false, InputType, OutputType>(
       input, ulp_tolerance, rounding);
@@ -362,8 +362,7 @@ template <Operation op, typename InputType, typename OutputType>
 __attribute__((no_sanitize("address"))) cpp::enable_if_t<
     is_valid_operation<op, InputType, OutputType>(),
     internal::MPFRMatcher<op, /*is_silent*/ true, InputType, OutputType>>
-get_silent_mpfr_matcher(InputType input,
-                        [[maybe_unused]] OutputType output_unused,
+get_silent_mpfr_matcher(InputType input, OutputType output_unused,
                         double ulp_tolerance, RoundingMode rounding) {
   return internal::MPFRMatcher<op, /*is_silent*/ true, InputType, OutputType>(
       input, ulp_tolerance, rounding);


        


More information about the llvm-branch-commits mailing list