[libc-commits] [libc] [libc] [Chore] Enable most libc disabled warnings (PR #122835)
via libc-commits
libc-commits at lists.llvm.org
Mon Jan 13 16:54:49 PST 2025
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 207e485f4b7e8113b8b329ddcde423aafc0a8832 843941769b1f41eddfcd4fcfed3641a3bbb99a20 --extensions h,cpp -- libc/src/__support/CPP/bit.h libc/src/string/memory_utils/utils.h libc/test/UnitTest/LibcDeathTestExecutors.cpp libc/test/UnitTest/LibcTest.h libc/test/include/stdbit_stub.h libc/test/src/__support/CPP/bit_test.cpp libc/test/src/__support/CPP/integer_sequence_test.cpp libc/test/src/__support/arg_list_test.cpp libc/test/src/__support/big_int_test.cpp libc/test/src/__support/hash_test.cpp libc/test/src/__support/math_extras_test.cpp libc/test/src/math/FModTest.h libc/test/src/math/smoke/nan_test.cpp libc/test/src/math/smoke/nanf_test.cpp libc/test/src/math/smoke/nanl_test.cpp libc/test/src/string/memory_utils/op_tests.cpp libc/test/src/strings/bzero_test.cpp libc/utils/MPFRWrapper/MPFRUtils.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/test/UnitTest/LibcDeathTestExecutors.cpp b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
index f693985571..b0968cf6a7 100644
--- a/libc/test/UnitTest/LibcDeathTestExecutors.cpp
+++ b/libc/test/UnitTest/LibcDeathTestExecutors.cpp
@@ -22,7 +22,7 @@ namespace LIBC_NAMESPACE_DECL {
namespace testing {
bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
- const char *LHSStr, 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/include/stdbit_stub.h b/libc/test/include/stdbit_stub.h
index 58baf493d8..e73a2117d6 100644
--- a/libc/test/include/stdbit_stub.h
+++ b/libc/test/include/stdbit_stub.h
@@ -17,10 +17,10 @@
#include <stdbool.h> // bool in C
#define STDBIT_STUB_FUNCTION(FUNC_NAME, LEADING_VAL) \
- unsigned FUNC_NAME##_uc(unsigned char) { return LEADING_VAL##AU; } \
- unsigned FUNC_NAME##_us(unsigned short) { return LEADING_VAL##BU; } \
- unsigned FUNC_NAME##_ui(unsigned int) { return LEADING_VAL##CU; } \
- unsigned FUNC_NAME##_ul(unsigned long) { return LEADING_VAL##DU; } \
+ unsigned FUNC_NAME##_uc(unsigned char) { return LEADING_VAL##AU; } \
+ unsigned FUNC_NAME##_us(unsigned short) { return LEADING_VAL##BU; } \
+ unsigned FUNC_NAME##_ui(unsigned int) { return LEADING_VAL##CU; } \
+ unsigned FUNC_NAME##_ul(unsigned long) { return LEADING_VAL##DU; } \
unsigned FUNC_NAME##_ull(unsigned long long) { return LEADING_VAL##EU; }
__BEGIN_C_DECLS
diff --git a/libc/test/src/__support/CPP/integer_sequence_test.cpp b/libc/test/src/__support/CPP/integer_sequence_test.cpp
index 3a5ad77c9e..56e75f4962 100644
--- a/libc/test/src/__support/CPP/integer_sequence_test.cpp
+++ b/libc/test/src/__support/CPP/integer_sequence_test.cpp
@@ -23,7 +23,8 @@ TEST(LlvmLibcIntegerSequencetTest, Basic) {
(is_same_v<ULLSeq, make_integer_sequence<unsigned long long, 4>>));
}
-template <typename T, T... Ts> bool checkArray(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/arg_list_test.cpp b/libc/test/src/__support/arg_list_test.cpp
index cd6c569695..57714050f0 100644
--- a/libc/test/src/__support/arg_list_test.cpp
+++ b/libc/test/src/__support/arg_list_test.cpp
@@ -112,7 +112,8 @@ long int check_struct_type(int first, ...) {
S s = args.next_var<S>();
int last = args.next_var<int>();
- return s.c + s.s + s.i + s.l + static_cast<long>(s.f) + static_cast<long>(s.d) + last;
+ return s.c + s.s + s.i + s.l + static_cast<long>(s.f) +
+ static_cast<long>(s.d) + last;
}
TEST(LlvmLibcArgListTest, TestStructTypes) {
diff --git a/libc/test/src/string/memory_utils/op_tests.cpp b/libc/test/src/string/memory_utils/op_tests.cpp
index 0b12c7da00..dd76192404 100644
--- a/libc/test/src/string/memory_utils/op_tests.cpp
+++ b/libc/test/src/string/memory_utils/op_tests.cpp
@@ -72,7 +72,8 @@ 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, size_t /*size*/) {
+void CopyBlockAdaptor(cpp::span<char> dst, cpp::span<char> src,
+ size_t /*size*/) {
FnImpl(as_byte(dst), as_byte(src));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/122835
More information about the libc-commits
mailing list