From fd432151a607a997c417f32cb70650fc7728629a Mon Sep 17 00:00:00 2001 From: William Huynh <113542065+saturn691@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:26:40 +0100 Subject: [PATCH] [libc] Fix bugs found when testing with all headers (#144049) Fixes a couple of bugs found when building. The PR to enable the headers can be found here: #144114. - math.yaml: float128 guard - wchar.yaml: __restrict keyword order --- libc/include/math.yaml | 2 +- libc/include/wchar.yaml | 20 +++++++++---------- .../src/stdio/printf_core/converter_test.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libc/include/math.yaml b/libc/include/math.yaml index 466c08ade6fc..11bead074595 100644 --- a/libc/include/math.yaml +++ b/libc/include/math.yaml @@ -734,7 +734,7 @@ functions: - type: float128 - type: float128 - type: float128 - guards: LIBC_TYPES_HAS_FLOAT128 + guard: LIBC_TYPES_HAS_FLOAT128 - name: ffmal standards: - stdc diff --git a/libc/include/wchar.yaml b/libc/include/wchar.yaml index 1af15a6c112b..84db73d8f01e 100644 --- a/libc/include/wchar.yaml +++ b/libc/include/wchar.yaml @@ -109,8 +109,8 @@ functions: - stdc return_type: wchar_t * arguments: - - type: __restrict wchar_t * - - type: const __restrict wchar_t * + - type: wchar_t *__restrict + - type: const wchar_t *__restrict - type: size_t - name: wmemmove standards: @@ -125,16 +125,16 @@ functions: - stdc return_type: wchar_t * arguments: - - type: __restrict wchar_t * - - type: const __restrict wchar_t * + - type: wchar_t *__restrict + - type: const wchar_t *__restrict - type: size_t - name: wcscat standards: - stdc return_type: wchar_t * arguments: - - type: __restrict wchar_t * - - type: const __restrict wchar_t * + - type: wchar_t *__restrict + - type: const wchar_t *__restrict - name: wcsstr standards: - stdc @@ -147,13 +147,13 @@ functions: - stdc return_type: wchar_t * arguments: - - type: __restrict wchar_t * - - type: const __restrict wchar_t * + - type: wchar_t *__restrict + - type: const wchar_t *__restrict - type: size_t - name: wcscpy standards: - stdc return_type: wchar_t * arguments: - - type: __restrict wchar_t * - - type: const __restrict wchar_t * + - type: wchar_t *__restrict + - type: const wchar_t *__restrict diff --git a/libc/test/src/stdio/printf_core/converter_test.cpp b/libc/test/src/stdio/printf_core/converter_test.cpp index 96a00ae598ec..bf088937e410 100644 --- a/libc/test/src/stdio/printf_core/converter_test.cpp +++ b/libc/test/src/stdio/printf_core/converter_test.cpp @@ -124,7 +124,7 @@ TEST_F(LlvmLibcPrintfConverterTest, StringConversionSimple) { TEST_F(LlvmLibcPrintfConverterTest, StringConversionPrecisionHigh) { LIBC_NAMESPACE::printf_core::FormatSection high_precision_conv; high_precision_conv.has_conv = true; - high_precision_conv.raw_string = "%4s"; + high_precision_conv.raw_string = "%.4s"; high_precision_conv.conv_name = 's'; high_precision_conv.precision = 4; high_precision_conv.conv_val_ptr = const_cast("456");