Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] remove errno.h includes #110934

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Jobhdez
Copy link
Contributor

@Jobhdez Jobhdez commented Oct 2, 2024

No description provided.

@llvmbot llvmbot added the libc label Oct 2, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2024

@llvm/pr-subscribers-libc

Author: Job Henandez Lara (Jobhdez)

Changes

Patch is 52.25 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/110934.diff

124 Files Affected:

  • (modified) libc/src/__support/StringUtil/tables/CMakeLists.txt (+1)
  • (modified) libc/src/__support/StringUtil/tables/linux_extension_errors.h (+1-1)
  • (modified) libc/src/__support/StringUtil/tables/posix_errors.h (-1)
  • (modified) libc/src/__support/StringUtil/tables/stdc_errors.h (-1)
  • (modified) libc/src/errno/libc_errno.h (-2)
  • (modified) libc/src/math/generic/acosf.cpp (-1)
  • (modified) libc/src/math/generic/asinf.cpp (-1)
  • (modified) libc/src/math/generic/cosf.cpp (-1)
  • (modified) libc/src/math/generic/exp.cpp (-1)
  • (modified) libc/src/math/generic/exp10.cpp (-1)
  • (modified) libc/src/math/generic/exp10f_impl.h (-1)
  • (modified) libc/src/math/generic/exp2.cpp (-1)
  • (modified) libc/src/math/generic/exp2f_impl.h (-1)
  • (modified) libc/src/math/generic/expf.cpp (-1)
  • (modified) libc/src/math/generic/explogxf.h (-1)
  • (modified) libc/src/math/generic/expm1f.cpp (-1)
  • (modified) libc/src/math/generic/powf.cpp (-1)
  • (modified) libc/src/math/generic/sincosf.cpp (-1)
  • (modified) libc/src/math/generic/sinf.cpp (-1)
  • (modified) libc/src/math/generic/tanf.cpp (-1)
  • (modified) libc/src/pthread/pthread_atfork.cpp (-1)
  • (modified) libc/src/pthread/pthread_attr_setdetachstate.cpp (-1)
  • (modified) libc/src/pthread/pthread_attr_setguardsize.cpp (-1)
  • (modified) libc/src/pthread/pthread_attr_setstack.cpp (-1)
  • (modified) libc/src/pthread/pthread_attr_setstacksize.cpp (-1)
  • (modified) libc/src/pthread/pthread_condattr_setclock.cpp (-1)
  • (modified) libc/src/pthread/pthread_condattr_setpshared.cpp (-1)
  • (modified) libc/src/pthread/pthread_create.cpp (-1)
  • (modified) libc/src/pthread/pthread_key_create.cpp (-1)
  • (modified) libc/src/pthread/pthread_key_delete.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutex_init.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_destroy.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_getpshared.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_getrobust.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_gettype.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_setpshared.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_setrobust.cpp (-1)
  • (modified) libc/src/pthread/pthread_mutexattr_settype.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_destroy.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_init.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_rdlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_timedrdlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_timedwrlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_tryrdlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_trywrlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_unlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlock_wrlock.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlockattr_setkind_np.cpp (-1)
  • (modified) libc/src/pthread/pthread_rwlockattr_setpshared.cpp (-1)
  • (modified) libc/src/pthread/pthread_setspecific.cpp (-1)
  • (modified) libc/src/spawn/posix_spawn_file_actions_addclose.cpp (-1)
  • (modified) libc/src/spawn/posix_spawn_file_actions_adddup2.cpp (-1)
  • (modified) libc/src/spawn/posix_spawn_file_actions_addopen.cpp (-1)
  • (modified) libc/src/spawn/posix_spawn_file_actions_destroy.cpp (-1)
  • (modified) libc/src/threads/thrd_create.cpp (-1)
  • (modified) libc/test/UnitTest/PrintfMatcher.h (-1)
  • (modified) libc/test/UnitTest/ScanfMatcher.h (-1)
  • (modified) libc/test/integration/src/pthread/pthread_name_test.cpp (-1)
  • (modified) libc/test/integration/src/spawn/posix_spawn_test_binary.cpp (-1)
  • (modified) libc/test/integration/src/unistd/fork_test.cpp (-1)
  • (modified) libc/test/integration/src/unistd/stack_smashing_test.cpp (-1)
  • (modified) libc/test/integration/startup/linux/tls_test.cpp (-1)
  • (modified) libc/test/src/math/RoundToIntegerTest.h (-1)
  • (modified) libc/test/src/math/acosf_test.cpp (-1)
  • (modified) libc/test/src/math/acoshf_test.cpp (-1)
  • (modified) libc/test/src/math/asinf_test.cpp (-1)
  • (modified) libc/test/src/math/asinhf_test.cpp (-1)
  • (modified) libc/test/src/math/atanf_test.cpp (-1)
  • (modified) libc/test/src/math/atanhf_test.cpp (-1)
  • (modified) libc/test/src/math/cosf_test.cpp (-1)
  • (modified) libc/test/src/math/coshf_test.cpp (-1)
  • (modified) libc/test/src/math/erff_test.cpp (-1)
  • (modified) libc/test/src/math/exp10_test.cpp (-1)
  • (modified) libc/test/src/math/exp2_test.cpp (-1)
  • (modified) libc/test/src/math/exp_test.cpp (-1)
  • (modified) libc/test/src/math/log10_test.cpp (-1)
  • (modified) libc/test/src/math/log10f_test.cpp (-1)
  • (modified) libc/test/src/math/log1p_test.cpp (-1)
  • (modified) libc/test/src/math/log1pf_test.cpp (-1)
  • (modified) libc/test/src/math/log2_test.cpp (-1)
  • (modified) libc/test/src/math/log_test.cpp (-1)
  • (modified) libc/test/src/math/powf_test.cpp (-1)
  • (modified) libc/test/src/math/sincosf_test.cpp (-1)
  • (modified) libc/test/src/math/sinf_test.cpp (-1)
  • (modified) libc/test/src/math/sinhf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/RoundToIntegerTest.h (-1)
  • (modified) libc/test/src/math/smoke/acosf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/acoshf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/asinf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/asinhf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/atanf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/atanhf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/cosf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/coshf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/erff_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/exp10_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/exp2_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/exp_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/expm1_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log10_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log10f_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log1p_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log1pf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log2_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/log_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/powf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/sincosf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/sinf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/sinhf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/tanf_test.cpp (-1)
  • (modified) libc/test/src/math/smoke/tanhf_test.cpp (-1)
  • (modified) libc/test/src/math/tanf_test.cpp (-1)
  • (modified) libc/test/src/math/tanhf_test.cpp (-1)
  • (modified) libc/test/src/pthread/pthread_attr_test.cpp (-1)
  • (modified) libc/test/src/pthread/pthread_mutexattr_test.cpp (-1)
  • (modified) libc/test/src/signal/sigaddset_test.cpp (-1)
  • (modified) libc/test/src/signal/sigdelset_test.cpp (-1)
  • (modified) libc/test/src/signal/sigfillset_test.cpp (-1)
  • (modified) libc/test/src/spawn/posix_spawn_file_actions_test.cpp (-1)
  • (modified) libc/test/src/sys/prctl/linux/prctl_test.cpp (-1)
  • (modified) libc/test/src/sys/select/select_failure_test.cpp (-1)
  • (modified) libc/test/src/sys/utsname/uname_test.cpp (-1)
  • (modified) libc/test/src/sys/wait/wait4_test.cpp (-1)
  • (modified) libc/test/src/sys/wait/waitpid_test.cpp (-1)
diff --git a/libc/src/__support/StringUtil/tables/CMakeLists.txt b/libc/src/__support/StringUtil/tables/CMakeLists.txt
index b7bb33ee0a0fe2..fffe93592f01d2 100644
--- a/libc/src/__support/StringUtil/tables/CMakeLists.txt
+++ b/libc/src/__support/StringUtil/tables/CMakeLists.txt
@@ -23,6 +23,7 @@ add_header_library(
   DEPENDS
     libc.include.errno
     libc.src.__support.StringUtil.message_mapper
+    libc.src.errno.libc_errno
 )
 
 add_header_library(
diff --git a/libc/src/__support/StringUtil/tables/linux_extension_errors.h b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
index f6e8dea154d3be..02ac3c011b1e3a 100644
--- a/libc/src/__support/StringUtil/tables/linux_extension_errors.h
+++ b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
@@ -11,8 +11,8 @@
 
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
+#include "src/errno/libc_errno.h"
 
-#include <errno.h> // For error macros
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/__support/StringUtil/tables/posix_errors.h b/libc/src/__support/StringUtil/tables/posix_errors.h
index 5294f85eb8d24e..65390ceade9f3b 100644
--- a/libc/src/__support/StringUtil/tables/posix_errors.h
+++ b/libc/src/__support/StringUtil/tables/posix_errors.h
@@ -12,7 +12,6 @@
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h> // For error macros
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/__support/StringUtil/tables/stdc_errors.h b/libc/src/__support/StringUtil/tables/stdc_errors.h
index 1f0beef82001cd..f4f981785c9e1d 100644
--- a/libc/src/__support/StringUtil/tables/stdc_errors.h
+++ b/libc/src/__support/StringUtil/tables/stdc_errors.h
@@ -12,7 +12,6 @@
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h> // For error macros
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/errno/libc_errno.h b/libc/src/errno/libc_errno.h
index 44ee2714843bab..49c9146b28c606 100644
--- a/libc/src/errno/libc_errno.h
+++ b/libc/src/errno/libc_errno.h
@@ -21,13 +21,11 @@
 
 // Unit and hermetic tests should:
 // - #include "src/errno/libc_errno.h"
-// - NOT #include <errno.h>
 // - Only use `libc_errno` in the code
 // - Depend on libc.src.errno.errno
 
 // Integration tests should:
 // - NOT #include "src/errno/libc_errno.h"
-// - #include <errno.h>
 // - Use regular `errno` in the code
 // - Still depend on libc.src.errno.errno
 
diff --git a/libc/src/math/generic/acosf.cpp b/libc/src/math/generic/acosf.cpp
index 95d8bc0213cba7..cf9721f8c425a3 100644
--- a/libc/src/math/generic/acosf.cpp
+++ b/libc/src/math/generic/acosf.cpp
@@ -16,7 +16,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 #include "inv_trigf_utils.h"
 
diff --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index d6acc3a1692bc4..f92f6368b0aa95 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -17,7 +17,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 #include "inv_trigf_utils.h"
 
diff --git a/libc/src/math/generic/cosf.cpp b/libc/src/math/generic/cosf.cpp
index 6a59b3763b6e87..18e019ae7c4595 100644
--- a/libc/src/math/generic/cosf.cpp
+++ b/libc/src/math/generic/cosf.cpp
@@ -18,7 +18,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/exp.cpp b/libc/src/math/generic/exp.cpp
index df0c2eab7155c6..0b56770c0c3e22 100644
--- a/libc/src/math/generic/exp.cpp
+++ b/libc/src/math/generic/exp.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/exp10.cpp b/libc/src/math/generic/exp10.cpp
index d01bbd8fc01c32..68d9608b379785 100644
--- a/libc/src/math/generic/exp10.cpp
+++ b/libc/src/math/generic/exp10.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/exp10f_impl.h b/libc/src/math/generic/exp10f_impl.h
index fe2195c6e04739..2bdd4cd465c0ef 100644
--- a/libc/src/math/generic/exp10f_impl.h
+++ b/libc/src/math/generic/exp10f_impl.h
@@ -21,7 +21,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 namespace generic {
diff --git a/libc/src/math/generic/exp2.cpp b/libc/src/math/generic/exp2.cpp
index fbabb625af51fa..42625360284f99 100644
--- a/libc/src/math/generic/exp2.cpp
+++ b/libc/src/math/generic/exp2.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/exp2f_impl.h b/libc/src/math/generic/exp2f_impl.h
index 3f1c5ee68f081e..41751c7424ca85 100644
--- a/libc/src/math/generic/exp2f_impl.h
+++ b/libc/src/math/generic/exp2f_impl.h
@@ -21,7 +21,6 @@
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h"
 
-#include <errno.h>
 
 #include "explogxf.h"
 
diff --git a/libc/src/math/generic/expf.cpp b/libc/src/math/generic/expf.cpp
index 1d7c0478eb2250..51462d59289a64 100644
--- a/libc/src/math/generic/expf.cpp
+++ b/libc/src/math/generic/expf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/explogxf.h b/libc/src/math/generic/explogxf.h
index 7daed558f74b1e..88287c703db730 100644
--- a/libc/src/math/generic/explogxf.h
+++ b/libc/src/math/generic/explogxf.h
@@ -20,7 +20,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/properties/cpu_features.h"
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index b1a0fe16de0771..47dd515456a605 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -21,7 +21,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index e3dee678a1a70a..f13c710e78e112 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -25,7 +25,6 @@
 #include "exp10f_impl.h" // Speedup for powf(10, y) = exp10f(y)
 #include "exp2f_impl.h"  // Speedup for powf(2, y) = exp2f(y)
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index 3bf8e9772231d6..449281293d2ae3 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -17,7 +17,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/math/generic/sinf.cpp b/libc/src/math/generic/sinf.cpp
index 43c2c2a8d883d2..62015070b29054 100644
--- a/libc/src/math/generic/sinf.cpp
+++ b/libc/src/math/generic/sinf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 #if defined(LIBC_TARGET_CPU_HAS_FMA)
 #include "range_reduction_fma.h"
diff --git a/libc/src/math/generic/tanf.cpp b/libc/src/math/generic/tanf.cpp
index 01d8c9855d461b..105518336f8e76 100644
--- a/libc/src/math/generic/tanf.cpp
+++ b/libc/src/math/generic/tanf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/pthread/pthread_atfork.cpp b/libc/src/pthread/pthread_atfork.cpp
index d3f3c259992ec2..62846c27a83195 100644
--- a/libc/src/pthread/pthread_atfork.cpp
+++ b/libc/src/pthread/pthread_atfork.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/fork_callbacks.h"
 
-#include <errno.h>
 #include <pthread.h> // For pthread_* type definitions.
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_attr_setdetachstate.cpp b/libc/src/pthread/pthread_attr_setdetachstate.cpp
index 3aa72d217f28b3..a413abdb70af2a 100644
--- a/libc/src/pthread/pthread_attr_setdetachstate.cpp
+++ b/libc/src/pthread/pthread_attr_setdetachstate.cpp
@@ -11,7 +11,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_attr_setguardsize.cpp b/libc/src/pthread/pthread_attr_setguardsize.cpp
index 389ee773fc5db5..8fb62bef422302 100644
--- a/libc/src/pthread/pthread_attr_setguardsize.cpp
+++ b/libc/src/pthread/pthread_attr_setguardsize.cpp
@@ -11,7 +11,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <linux/param.h> // For EXEC_PAGESIZE.
 #include <pthread.h>
 
diff --git a/libc/src/pthread/pthread_attr_setstack.cpp b/libc/src/pthread/pthread_attr_setstack.cpp
index f4f2d1450633ea..361591d87a0f0d 100644
--- a/libc/src/pthread/pthread_attr_setstack.cpp
+++ b/libc/src/pthread/pthread_attr_setstack.cpp
@@ -13,7 +13,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/thread.h" // For STACK_ALIGNMENT
 
-#include <errno.h>
 #include <pthread.h>
 #include <stdint.h>
 
diff --git a/libc/src/pthread/pthread_attr_setstacksize.cpp b/libc/src/pthread/pthread_attr_setstacksize.cpp
index f327d3365b5d85..59f5921daf4e50 100644
--- a/libc/src/pthread/pthread_attr_setstacksize.cpp
+++ b/libc/src/pthread/pthread_attr_setstacksize.cpp
@@ -11,7 +11,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_condattr_setclock.cpp b/libc/src/pthread/pthread_condattr_setclock.cpp
index 5c0144523f93e6..8422b19fd5e7b5 100644
--- a/libc/src/pthread/pthread_condattr_setclock.cpp
+++ b/libc/src/pthread/pthread_condattr_setclock.cpp
@@ -11,7 +11,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>     // EINVAL
 #include <pthread.h>   // pthread_condattr_t
 #include <sys/types.h> // clockid_t
 #include <time.h>      // CLOCK_MONOTONIC, CLOCK_REALTIME
diff --git a/libc/src/pthread/pthread_condattr_setpshared.cpp b/libc/src/pthread/pthread_condattr_setpshared.cpp
index 536aeadac5d446..29f8ee95b590c5 100644
--- a/libc/src/pthread/pthread_condattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_condattr_setpshared.cpp
@@ -11,7 +11,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h> // EINVAL
 #include <pthread.h> // pthread_condattr_t, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_create.cpp b/libc/src/pthread/pthread_create.cpp
index 1fb4b50109401c..5f829d13034964 100644
--- a/libc/src/pthread/pthread_create.cpp
+++ b/libc/src/pthread/pthread_create.cpp
@@ -20,7 +20,6 @@
 #include "src/__support/macros/optimization.h"
 #include "src/__support/threads/thread.h"
 
-#include <errno.h>
 #include <pthread.h> // For pthread_* type definitions.
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_key_create.cpp b/libc/src/pthread/pthread_key_create.cpp
index 0583baca22f4d4..f02fbdc782e778 100644
--- a/libc/src/pthread/pthread_key_create.cpp
+++ b/libc/src/pthread/pthread_key_create.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/thread.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_key_delete.cpp b/libc/src/pthread/pthread_key_delete.cpp
index 20484fa9bdf828..e77ebb99189d9c 100644
--- a/libc/src/pthread/pthread_key_delete.cpp
+++ b/libc/src/pthread/pthread_key_delete.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/thread.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutex_init.cpp b/libc/src/pthread/pthread_mutex_init.cpp
index 0281f732473d9d..94052e53d8c0ab 100644
--- a/libc/src/pthread/pthread_mutex_init.cpp
+++ b/libc/src/pthread/pthread_mutex_init.cpp
@@ -13,7 +13,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/mutex.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_destroy.cpp b/libc/src/pthread/pthread_mutexattr_destroy.cpp
index 3b2551afd11b55..4daf84d7cc0d89 100644
--- a/libc/src/pthread/pthread_mutexattr_destroy.cpp
+++ b/libc/src/pthread/pthread_mutexattr_destroy.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/pthread/pthread_mutexattr_getpshared.cpp b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
index 2d83a5229e9ecd..142eb9fd3b4526 100644
--- a/libc/src/pthread/pthread_mutexattr_getpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/pthread/pthread_mutexattr_getrobust.cpp b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
index 508b502a580087..9ce46833ecbf5f 100644
--- a/libc/src/pthread/pthread_mutexattr_getrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/pthread/pthread_mutexattr_gettype.cpp b/libc/src/pthread/pthread_mutexattr_gettype.cpp
index 3747bf5ce73e94..6ba3256b35f805 100644
--- a/libc/src/pthread/pthread_mutexattr_gettype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_gettype.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/pthread/pthread_mutexattr_setpshared.cpp b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
index b290de764c91b6..e1223750ec591a 100644
--- a/libc/src/pthread/pthread_mutexattr_setpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setpshared.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_setrobust.cpp b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
index e572827486c077..e1327e9ef1e028 100644
--- a/libc/src/pthread/pthread_mutexattr_setrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_setrobust.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_mutexattr_settype.cpp b/libc/src/pthread/pthread_mutexattr_settype.cpp
index 27e8ff859ba347..e23b52736bfc5e 100644
--- a/libc/src/pthread/pthread_mutexattr_settype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_settype.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_destroy.cpp b/libc/src/pthread/pthread_rwlock_destroy.cpp
index 345076aae43488..afc5622e54a003 100644
--- a/libc/src/pthread/pthread_rwlock_destroy.cpp
+++ b/libc/src/pthread/pthread_rwlock_destroy.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_init.cpp b/libc/src/pthread/pthread_rwlock_init.cpp
index d1a31625d0dabd..dc5424cbc4838d 100644
--- a/libc/src/pthread/pthread_rwlock_init.cpp
+++ b/libc/src/pthread/pthread_rwlock_init.cpp
@@ -14,7 +14,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_rdlock.cpp b/libc/src/pthread/pthread_rwlock_rdlock.cpp
index 16d82301c54a9a..7dee8eb9a44b12 100644
--- a/libc/src/pthread/pthread_rwlock_rdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_rdlock.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
index 905541014a4a46..710fb48e49573e 100644
--- a/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedrdlock.cpp
@@ -15,7 +15,6 @@
 #include "src/__support/threads/linux/rwlock.h"
 #include "src/__support/time/linux/abs_timeout.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_timedwrlock.cpp b/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
index f77ac40f22b897..d2dc70e992e82e 100644
--- a/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_timedwrlock.cpp
@@ -15,7 +15,6 @@
 #include "src/__support/threads/linux/rwlock.h"
 #include "src/__support/time/linux/abs_timeout.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_tryrdlock.cpp b/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
index da59a576b82747..d54b57f0560908 100644
--- a/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_tryrdlock.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_trywrlock.cpp b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
index ccd1bd49c402c6..0ebf1cb334cd07 100644
--- a/libc/src/pthread/pthread_rwlock_trywrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_trywrlock.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_unlock.cpp b/libc/src/pthread/pthread_rwlock_unlock.cpp
index 77c50a8e65fdfb..c5713922e1273a 100644
--- a/libc/src/pthread/pthread_rwlock_unlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_unlock.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#include <errno.h>
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_rwlock_wrlock.cpp b/libc/src/pthread/pthread_rwlock_wrlock.cpp
index c2561c81f4bd0e..f02fb6b5db9c09 100644
--- a/libc/src/pthread/pthread_rwlock_wrlock.cpp
+++ b/libc/src/pthread/pthread_rwlock_wrlock.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/threads/linux/rwlock.h"
 
-#i...
[truncated]

Copy link

github-actions bot commented Oct 2, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff e379b4b67f760e743d8bc826cc6de00a27109dbd 301b4855ec134f6c7d8f7cc0116488e8fda7e139 --extensions cpp,h -- libc/src/__support/StringUtil/tables/linux_extension_errors.h libc/src/__support/StringUtil/tables/posix_errors.h libc/src/__support/StringUtil/tables/stdc_errors.h libc/src/errno/libc_errno.h libc/src/math/generic/acosf.cpp libc/src/math/generic/asinf.cpp libc/src/math/generic/cosf.cpp libc/src/math/generic/exp.cpp libc/src/math/generic/exp10.cpp libc/src/math/generic/exp10f_impl.h libc/src/math/generic/exp2.cpp libc/src/math/generic/exp2f_impl.h libc/src/math/generic/expf.cpp libc/src/math/generic/explogxf.h libc/src/math/generic/expm1f.cpp libc/src/math/generic/powf.cpp libc/src/math/generic/sincosf.cpp libc/src/math/generic/sinf.cpp libc/src/math/generic/tanf.cpp libc/src/pthread/pthread_atfork.cpp libc/src/pthread/pthread_attr_setdetachstate.cpp libc/src/pthread/pthread_attr_setguardsize.cpp libc/src/pthread/pthread_attr_setstack.cpp libc/src/pthread/pthread_attr_setstacksize.cpp libc/src/pthread/pthread_condattr_setclock.cpp libc/src/pthread/pthread_condattr_setpshared.cpp libc/src/pthread/pthread_create.cpp libc/src/pthread/pthread_key_create.cpp libc/src/pthread/pthread_key_delete.cpp libc/src/pthread/pthread_mutex_init.cpp libc/src/pthread/pthread_mutexattr_destroy.cpp libc/src/pthread/pthread_mutexattr_getpshared.cpp libc/src/pthread/pthread_mutexattr_getrobust.cpp libc/src/pthread/pthread_mutexattr_gettype.cpp libc/src/pthread/pthread_mutexattr_setpshared.cpp libc/src/pthread/pthread_mutexattr_setrobust.cpp libc/src/pthread/pthread_mutexattr_settype.cpp libc/src/pthread/pthread_rwlock_destroy.cpp libc/src/pthread/pthread_rwlock_init.cpp libc/src/pthread/pthread_rwlock_rdlock.cpp libc/src/pthread/pthread_rwlock_timedrdlock.cpp libc/src/pthread/pthread_rwlock_timedwrlock.cpp libc/src/pthread/pthread_rwlock_tryrdlock.cpp libc/src/pthread/pthread_rwlock_trywrlock.cpp libc/src/pthread/pthread_rwlock_unlock.cpp libc/src/pthread/pthread_rwlock_wrlock.cpp libc/src/pthread/pthread_rwlockattr_setkind_np.cpp libc/src/pthread/pthread_rwlockattr_setpshared.cpp libc/src/pthread/pthread_setspecific.cpp libc/src/spawn/posix_spawn_file_actions_addclose.cpp libc/src/spawn/posix_spawn_file_actions_adddup2.cpp libc/src/spawn/posix_spawn_file_actions_addopen.cpp libc/src/spawn/posix_spawn_file_actions_destroy.cpp libc/src/threads/thrd_create.cpp libc/test/UnitTest/PrintfMatcher.h libc/test/UnitTest/ScanfMatcher.h libc/test/integration/src/pthread/pthread_name_test.cpp libc/test/integration/src/spawn/posix_spawn_test_binary.cpp libc/test/integration/src/unistd/fork_test.cpp libc/test/integration/src/unistd/stack_smashing_test.cpp libc/test/integration/startup/linux/tls_test.cpp libc/test/src/math/RoundToIntegerTest.h libc/test/src/math/acosf_test.cpp libc/test/src/math/acoshf_test.cpp libc/test/src/math/asinf_test.cpp libc/test/src/math/asinhf_test.cpp libc/test/src/math/atanf_test.cpp libc/test/src/math/atanhf_test.cpp libc/test/src/math/cosf_test.cpp libc/test/src/math/coshf_test.cpp libc/test/src/math/erff_test.cpp libc/test/src/math/exp10_test.cpp libc/test/src/math/exp2_test.cpp libc/test/src/math/exp_test.cpp libc/test/src/math/log10_test.cpp libc/test/src/math/log10f_test.cpp libc/test/src/math/log1p_test.cpp libc/test/src/math/log1pf_test.cpp libc/test/src/math/log2_test.cpp libc/test/src/math/log_test.cpp libc/test/src/math/powf_test.cpp libc/test/src/math/sincosf_test.cpp libc/test/src/math/sinf_test.cpp libc/test/src/math/sinhf_test.cpp libc/test/src/math/smoke/RoundToIntegerTest.h libc/test/src/math/smoke/acosf_test.cpp libc/test/src/math/smoke/acoshf_test.cpp libc/test/src/math/smoke/asinf_test.cpp libc/test/src/math/smoke/asinhf_test.cpp libc/test/src/math/smoke/atanf_test.cpp libc/test/src/math/smoke/atanhf_test.cpp libc/test/src/math/smoke/cosf_test.cpp libc/test/src/math/smoke/coshf_test.cpp libc/test/src/math/smoke/erff_test.cpp libc/test/src/math/smoke/exp10_test.cpp libc/test/src/math/smoke/exp2_test.cpp libc/test/src/math/smoke/exp_test.cpp libc/test/src/math/smoke/expm1_test.cpp libc/test/src/math/smoke/log10_test.cpp libc/test/src/math/smoke/log10f_test.cpp libc/test/src/math/smoke/log1p_test.cpp libc/test/src/math/smoke/log1pf_test.cpp libc/test/src/math/smoke/log2_test.cpp libc/test/src/math/smoke/log_test.cpp libc/test/src/math/smoke/powf_test.cpp libc/test/src/math/smoke/sincosf_test.cpp libc/test/src/math/smoke/sinf_test.cpp libc/test/src/math/smoke/sinhf_test.cpp libc/test/src/math/smoke/tanf_test.cpp libc/test/src/math/smoke/tanhf_test.cpp libc/test/src/math/tanf_test.cpp libc/test/src/math/tanhf_test.cpp libc/test/src/pthread/pthread_attr_test.cpp libc/test/src/pthread/pthread_mutexattr_test.cpp libc/test/src/signal/sigaddset_test.cpp libc/test/src/signal/sigdelset_test.cpp libc/test/src/signal/sigfillset_test.cpp libc/test/src/spawn/posix_spawn_file_actions_test.cpp libc/test/src/sys/prctl/linux/prctl_test.cpp libc/test/src/sys/select/select_failure_test.cpp libc/test/src/sys/utsname/uname_test.cpp libc/test/src/sys/wait/wait4_test.cpp libc/test/src/sys/wait/waitpid_test.cpp
View the diff from clang-format here.
diff --git a/libc/src/__support/StringUtil/tables/linux_extension_errors.h b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
index 02ac3c011b..425590f6e9 100644
--- a/libc/src/__support/StringUtil/tables/linux_extension_errors.h
+++ b/libc/src/__support/StringUtil/tables/linux_extension_errors.h
@@ -13,7 +13,6 @@
 #include "src/__support/macros/config.h"
 #include "src/errno/libc_errno.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 constexpr MsgTable<52> LINUX_ERRORS = {
diff --git a/libc/src/__support/StringUtil/tables/posix_errors.h b/libc/src/__support/StringUtil/tables/posix_errors.h
index 65390ceade..dcdafade89 100644
--- a/libc/src/__support/StringUtil/tables/posix_errors.h
+++ b/libc/src/__support/StringUtil/tables/posix_errors.h
@@ -12,7 +12,6 @@
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LIBC_INLINE_VAR constexpr MsgTable<76> POSIX_ERRORS = {
diff --git a/libc/src/__support/StringUtil/tables/stdc_errors.h b/libc/src/__support/StringUtil/tables/stdc_errors.h
index f4f981785c..b2a0d36a53 100644
--- a/libc/src/__support/StringUtil/tables/stdc_errors.h
+++ b/libc/src/__support/StringUtil/tables/stdc_errors.h
@@ -12,7 +12,6 @@
 #include "src/__support/StringUtil/message_mapper.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LIBC_INLINE_VAR constexpr const MsgTable<4> STDC_ERRORS = {
diff --git a/libc/src/math/generic/acosf.cpp b/libc/src/math/generic/acosf.cpp
index cf9721f8c4..3c097a7871 100644
--- a/libc/src/math/generic/acosf.cpp
+++ b/libc/src/math/generic/acosf.cpp
@@ -16,7 +16,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 #include "inv_trigf_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index f92f6368b0..3a89def8f6 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -17,7 +17,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 #include "inv_trigf_utils.h"
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/cosf.cpp b/libc/src/math/generic/cosf.cpp
index 18e019ae7c..972ffa923a 100644
--- a/libc/src/math/generic/cosf.cpp
+++ b/libc/src/math/generic/cosf.cpp
@@ -18,7 +18,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 // Exceptional cases for cosf.
diff --git a/libc/src/math/generic/exp.cpp b/libc/src/math/generic/exp.cpp
index 0b56770c0c..38b683aa01 100644
--- a/libc/src/math/generic/exp.cpp
+++ b/libc/src/math/generic/exp.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp10.cpp b/libc/src/math/generic/exp10.cpp
index 68d9608b37..748c8a22b2 100644
--- a/libc/src/math/generic/exp10.cpp
+++ b/libc/src/math/generic/exp10.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp10f_impl.h b/libc/src/math/generic/exp10f_impl.h
index 2bdd4cd465..d741318382 100644
--- a/libc/src/math/generic/exp10f_impl.h
+++ b/libc/src/math/generic/exp10f_impl.h
@@ -21,7 +21,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 namespace LIBC_NAMESPACE_DECL {
 namespace generic {
 
diff --git a/libc/src/math/generic/exp2.cpp b/libc/src/math/generic/exp2.cpp
index 4262536028..935548b538 100644
--- a/libc/src/math/generic/exp2.cpp
+++ b/libc/src/math/generic/exp2.cpp
@@ -25,7 +25,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/exp2f_impl.h b/libc/src/math/generic/exp2f_impl.h
index 41751c7424..ae2d0628c1 100644
--- a/libc/src/math/generic/exp2f_impl.h
+++ b/libc/src/math/generic/exp2f_impl.h
@@ -21,7 +21,6 @@
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h"
 
-
 #include "explogxf.h"
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/math/generic/expf.cpp b/libc/src/math/generic/expf.cpp
index 51462d5928..ee5c2a32b6 100644
--- a/libc/src/math/generic/expf.cpp
+++ b/libc/src/math/generic/expf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float, expf, (float x)) {
diff --git a/libc/src/math/generic/explogxf.h b/libc/src/math/generic/explogxf.h
index 88287c703d..f3f50c21aa 100644
--- a/libc/src/math/generic/explogxf.h
+++ b/libc/src/math/generic/explogxf.h
@@ -20,7 +20,6 @@
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/properties/cpu_features.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 struct ExpBase {
diff --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index 47dd515456..d5e9e85ed4 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -21,7 +21,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float, expm1f, (float x)) {
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index f13c710e78..8ce2465ba2 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -25,7 +25,6 @@
 #include "exp10f_impl.h" // Speedup for powf(10, y) = exp10f(y)
 #include "exp2f_impl.h"  // Speedup for powf(2, y) = exp2f(y)
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 using fputil::DoubleDouble;
diff --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index 449281293d..ccaa29c10c 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -17,7 +17,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 // Exceptional values
diff --git a/libc/src/math/generic/sinf.cpp b/libc/src/math/generic/sinf.cpp
index 62015070b2..cea267d4c6 100644
--- a/libc/src/math/generic/sinf.cpp
+++ b/libc/src/math/generic/sinf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 #if defined(LIBC_TARGET_CPU_HAS_FMA)
 #include "range_reduction_fma.h"
 #else
diff --git a/libc/src/math/generic/tanf.cpp b/libc/src/math/generic/tanf.cpp
index 105518336f..6fd5f9a103 100644
--- a/libc/src/math/generic/tanf.cpp
+++ b/libc/src/math/generic/tanf.cpp
@@ -19,7 +19,6 @@
 #include "src/__support/macros/optimization.h"            // LIBC_UNLIKELY
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 // Exceptional cases for tanf.
diff --git a/libc/src/pthread/pthread_mutexattr_destroy.cpp b/libc/src/pthread/pthread_mutexattr_destroy.cpp
index 4daf84d7cc..bddeb8b75a 100644
--- a/libc/src/pthread/pthread_mutexattr_destroy.cpp
+++ b/libc/src/pthread/pthread_mutexattr_destroy.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, pthread_mutexattr_destroy, (pthread_mutexattr_t *)) {
diff --git a/libc/src/pthread/pthread_mutexattr_getpshared.cpp b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
index 142eb9fd3b..0ea5d42834 100644
--- a/libc/src/pthread/pthread_mutexattr_getpshared.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getpshared.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, pthread_mutexattr_getpshared,
diff --git a/libc/src/pthread/pthread_mutexattr_getrobust.cpp b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
index 9ce46833ec..b2359e0ac8 100644
--- a/libc/src/pthread/pthread_mutexattr_getrobust.cpp
+++ b/libc/src/pthread/pthread_mutexattr_getrobust.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, pthread_mutexattr_getrobust,
diff --git a/libc/src/pthread/pthread_mutexattr_gettype.cpp b/libc/src/pthread/pthread_mutexattr_gettype.cpp
index 6ba3256b35..0bd226ef89 100644
--- a/libc/src/pthread/pthread_mutexattr_gettype.cpp
+++ b/libc/src/pthread/pthread_mutexattr_gettype.cpp
@@ -12,7 +12,6 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(int, pthread_mutexattr_gettype,
diff --git a/libc/test/UnitTest/PrintfMatcher.h b/libc/test/UnitTest/PrintfMatcher.h
index 4323a69e51..4f79832ab5 100644
--- a/libc/test/UnitTest/PrintfMatcher.h
+++ b/libc/test/UnitTest/PrintfMatcher.h
@@ -13,7 +13,6 @@
 #include "src/stdio/printf_core/core_structs.h"
 #include "test/UnitTest/Test.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 namespace testing {
 
diff --git a/libc/test/UnitTest/ScanfMatcher.h b/libc/test/UnitTest/ScanfMatcher.h
index d106f17734..cb9d13f757 100644
--- a/libc/test/UnitTest/ScanfMatcher.h
+++ b/libc/test/UnitTest/ScanfMatcher.h
@@ -13,7 +13,6 @@
 #include "src/stdio/scanf_core/core_structs.h"
 #include "test/UnitTest/Test.h"
 
-
 namespace LIBC_NAMESPACE_DECL {
 namespace testing {
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start to the cleanup, but this patch fails to build in fullbuild mode due to some of these files still needing errno macros.

@@ -21,13 +21,11 @@

// Unit and hermetic tests should:
// - #include "src/errno/libc_errno.h"
// - NOT #include <errno.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these comments should probably stay.

@@ -12,7 +12,6 @@
#include "src/__support/StringUtil/message_mapper.h"
#include "src/__support/macros/config.h"

#include <errno.h> // For error macros
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other error table files also need to include libc_errno.h. Also it seems like we don't have a complete list of errno macros in our include files so those will need to be updated before we can remove the public errno includes from these files.

@Jobhdez
Copy link
Contributor Author

Jobhdez commented Oct 2, 2024

This is a good start to the cleanup, but this patch fails to build in fullbuild mode due to some of these files still needing errno macros.

I see. I only built in overlay mode. I'll address your review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants