[libc-commits] [libc] [libc] remove errno.h includes (PR #110934)

via libc-commits libc-commits at lists.llvm.org
Wed Oct 2 15:27:50 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
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
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
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 {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/110934


More information about the libc-commits mailing list