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] Add strftime_l #127708

Merged
merged 3 commits into from
Feb 19, 2025
Merged

[libc] Add strftime_l #127708

merged 3 commits into from
Feb 19, 2025

Conversation

petrhosek
Copy link
Member

This is a (no-op) locale version of strftime.

This is a (no-op) locale version of strftime.
@llvmbot
Copy link
Member

llvmbot commented Feb 18, 2025

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

This is a (no-op) locale version of strftime.


Full diff: https://github.com/llvm/llvm-project/pull/127708.diff

8 Files Affected:

  • (modified) libc/config/baremetal/aarch64/entrypoints.txt (+1)
  • (modified) libc/config/baremetal/arm/entrypoints.txt (+1)
  • (modified) libc/config/baremetal/riscv/entrypoints.txt (+1)
  • (modified) libc/include/time.yaml (+11)
  • (modified) libc/src/time/CMakeLists.txt (+11)
  • (modified) libc/src/time/strftime.cpp (-1)
  • (added) libc/src/time/strftime_l.cpp (+33)
  • (added) libc/src/time/strftime_l.h (+25)
diff --git a/libc/config/baremetal/aarch64/entrypoints.txt b/libc/config/baremetal/aarch64/entrypoints.txt
index 44c4ab49e5c58..8becbe41c6e14 100644
--- a/libc/config/baremetal/aarch64/entrypoints.txt
+++ b/libc/config/baremetal/aarch64/entrypoints.txt
@@ -248,6 +248,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.time.gmtime
     libc.src.time.gmtime_r
     libc.src.time.mktime
+    libc.src.time.strftime_l
     libc.src.time.timespec_get
 
     # internal entrypoints
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index 370b5462fe9e8..99a9b9a645e70 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -248,6 +248,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.time.gmtime
     libc.src.time.gmtime_r
     libc.src.time.mktime
+    libc.src.time.strftime_l
     libc.src.time.timespec_get
 
     # internal entrypoints
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 07311a60a17a2..91e4b14a46228 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -244,6 +244,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.time.gmtime
     libc.src.time.gmtime_r
     libc.src.time.mktime
+    libc.src.time.strftime_l
     libc.src.time.timespec_get
 
     # internal entrypoints
diff --git a/libc/include/time.yaml b/libc/include/time.yaml
index 37ee824678cda..7bb25dbe85ac4 100644
--- a/libc/include/time.yaml
+++ b/libc/include/time.yaml
@@ -9,6 +9,7 @@ types:
   - type_name: time_t
   - type_name: clock_t
   - type_name: size_t
+  - type_name: locale_t
 enums: []
 objects: []
 functions:
@@ -100,6 +101,16 @@ functions:
       - type: size_t
       - type: const char *__restrict
       - type: const struct tm *__restrict
+  - name: strftime_l
+    standard:
+      - stdc
+    return_type: size_t
+    arguments:
+      - type: char *__restrict
+      - type: size_t
+      - type: const char *__restrict
+      - type: const struct tm *__restrict
+      - type: locale_t
   - name: time
     standard:
       - stdc
diff --git a/libc/src/time/CMakeLists.txt b/libc/src/time/CMakeLists.txt
index 8332e8ab66f97..868253f4b03b5 100644
--- a/libc/src/time/CMakeLists.txt
+++ b/libc/src/time/CMakeLists.txt
@@ -150,6 +150,17 @@ add_entrypoint_object(
     libc.src.time.strftime_core.strftime_main
 )
 
+add_entrypoint_object(
+  strftime_l
+  SRCS
+    strftime_l.cpp
+  HDRS
+    strftime_l.h
+  DEPENDS
+    libc.hdr.types.size_t
+    libc.hdr.types.struct_tm
+)
+
 add_entrypoint_object(
   time
   SRCS
diff --git a/libc/src/time/strftime.cpp b/libc/src/time/strftime.cpp
index 4b89bf2ea3a70..c19e58fbadf71 100644
--- a/libc/src/time/strftime.cpp
+++ b/libc/src/time/strftime.cpp
@@ -19,7 +19,6 @@ namespace LIBC_NAMESPACE_DECL {
 LLVM_LIBC_FUNCTION(size_t, strftime,
                    (char *__restrict buffer, size_t buffsz,
                     const char *__restrict format, const tm *timeptr)) {
-
   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
   printf_core::Writer writer(&wb);
   int ret = strftime_core::strftime_main(&writer, format, timeptr);
diff --git a/libc/src/time/strftime_l.cpp b/libc/src/time/strftime_l.cpp
new file mode 100644
index 0000000000000..4203136af4cba
--- /dev/null
+++ b/libc/src/time/strftime_l.cpp
@@ -0,0 +1,33 @@
+//===-- Implementation of strftime_l function -----------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/time/strftime_l.h"
+#include "hdr/types/size_t.h"
+#include "hdr/types/struct_tm.h"
+#include "include/llvm-libc-types/locale_t.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/stdio/printf_core/writer.h"
+#include "src/time/strftime_core/strftime_main.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+// TODO: Add support for locales.
+LLVM_LIBC_FUNCTION(size_t, strftime_l,
+                   (char *__restrict buffer, size_t count,
+                    const char *__restrict format,
+                    const struct tm *__restrict tp, locale_t)) {
+  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
+  printf_core::Writer writer(&wb);
+  int ret = strftime_core::strftime_main(&writer, format, timeptr);
+  if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
+    wb.buff[wb.buff_cur] = '\0';
+  return (ret < 0 || static_cast<size_t>(ret) > buffsz) ? 0 : ret;
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/time/strftime_l.h b/libc/src/time/strftime_l.h
new file mode 100644
index 0000000000000..57a6d4070cd06
--- /dev/null
+++ b/libc/src/time/strftime_l.h
@@ -0,0 +1,25 @@
+//===-- Implementation header for strftime_l --------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_TIME_STRFTIME_L_H
+#define LLVM_LIBC_SRC_TIME_STRFTIME_L_H
+
+#include "hdr/types/size_t.h"
+#include "hdr/types/struct_tm.h"
+#include "include/llvm-libc-types/locale_t.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+size_t strftime_l(char *__restrict buffer, size_t count,
+                  const char *__restrict format, const struct tm *__restrict tp,
+                  locale_t);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_STRING_STRCOLL_L_H

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.

LGTM with minor changes

strftime_l.h
DEPENDS
libc.hdr.types.size_t
libc.hdr.types.struct_tm
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs the rest of the dependencies from strftime

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -248,6 +248,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.time.gmtime
libc.src.time.gmtime_r
libc.src.time.mktime
libc.src.time.strftime_l
Copy link
Contributor

Choose a reason for hiding this comment

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

you should add strftime_l to the other targets as well. I should probably also look into adding strftime to more targets, I think I only added it to x86_64/linux

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@petrhosek petrhosek merged commit 9072ba7 into llvm:main Feb 19, 2025
11 of 13 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 19, 2025

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-gcc-fullbuild-dbg running on libc-x86_64-debian-fullbuild while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/131/builds/16265

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[52/80] Generating header sys/utsname.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/sys/utsname.yaml
[53/79] Generating header sys/socket.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/sys/socket.yaml
[54/77] Generating header locale.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/locale.yaml
[55/77] Generating header sys/wait.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/sys/wait.yaml
[56/74] Generating header poll.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/poll.yaml
[57/74] Generating header termios.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/termios.yaml
[58/63] Generating header math.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/runtimes/../libc/include/math.yaml
[59/63] Building CXX object compiler-rt/lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/mem_map_linux.cpp.o
[60/63] Building CXX object compiler-rt/lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/linux.cpp.o
[61/63] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o
FAILED: libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -DLIBC_COPT_PUBLIC_PACKAGING -std=gnu++17 -MD -MT libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -MF libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o.d -o libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp: In function ‘size_t __llvm_libc_20_0_0_git::__strftime_l_impl__(char*, size_t, const char*, const tm*, locale_t)’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:25:40: error: ‘buffsz’ was not declared in this scope; did you mean ‘buffer’?
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                        ^~~~~~
      |                                        buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:27:59: error: ‘timeptr’ was not declared in this scope
   27 |   int ret = strftime_core::strftime_main(&writer, format, timeptr);
      |                                                           ^~~~~~~
[62/63] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime.dir/strftime.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 126, in main
    run_command(['ninja', 'libc'])
  File "/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
@@@BUILD_STEP build libc-startup@@@
Running: ninja libc-startup

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 19, 2025

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-fullbuild-dbg-asan running on libc-x86_64-debian-fullbuild while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/171/builds/16118

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[50/94] Generating header sys/mman.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/sys/mman.yaml
[51/76] Generating header sys/uio.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/sys/uio.yaml
[52/76] Generating header sys/select.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/sys/select.yaml
[53/75] Generating header poll.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/poll.yaml
[54/75] Generating header uchar.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/uchar.yaml
[55/75] Generating header termios.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/termios.yaml
[56/64] Generating header sys/wait.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/sys/wait.yaml
[57/61] Generating header wchar.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/wchar.yaml
[58/61] Generating header math.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/runtimes/../libc/include/math.yaml
[59/61] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o
FAILED: libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=gnu++17 -MD -MT libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -MF libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o.d -o libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:25:40: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                       ^~~~~~
                                       buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:25:47: error: ordered comparison between pointer and zero ('char *' and 'int')
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                       ~~~~~~ ^ ~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:25:53: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                                    ^~~~~~
                                                    buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:27:59: error: use of undeclared identifier 'timeptr'
  int ret = strftime_core::strftime_main(&writer, format, timeptr);
                                                          ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:28:7: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      ^~~~~~
      buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:28:14: error: ordered comparison between pointer and zero ('char *' and 'int')
  if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      ~~~~~~ ^ ~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:30:49: error: use of undeclared identifier 'buffsz'
  return (ret < 0 || static_cast<size_t>(ret) > buffsz) ? 0 : ret;
                                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:22:53: error: unused parameter 'count' [-Werror,-Wunused-parameter]
                   (char *__restrict buffer, size_t count,
                                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/time/strftime_l.cpp:24:49: error: unused parameter 'tp' [-Werror,-Wunused-parameter]

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 19, 2025

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-fullbuild-dbg running on libc-x86_64-debian-fullbuild while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/179/builds/16103

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[52/86] Generating header sys/stat.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/sys/stat.yaml
[53/77] Generating header wchar.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/wchar.yaml
[54/77] Generating header sys/wait.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/sys/wait.yaml
[55/74] Generating header termios.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/termios.yaml
[56/63] Generating header uchar.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/uchar.yaml
[57/63] Generating header poll.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/poll.yaml
[58/63] Generating header math.h from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/runtimes/../libc/include/math.yaml
[59/63] Building CXX object compiler-rt/lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/mem_map_linux.cpp.o
[60/63] Building CXX object compiler-rt/lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/linux.cpp.o
[61/63] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o
FAILED: libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=gnu++17 -MD -MT libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -MF libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o.d -o libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:25:40: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                       ^~~~~~
                                       buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:25:47: error: ordered comparison between pointer and zero ('char *' and 'int')
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                       ~~~~~~ ^ ~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:25:53: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
                                                    ^~~~~~
                                                    buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:27:59: error: use of undeclared identifier 'timeptr'
  int ret = strftime_core::strftime_main(&writer, format, timeptr);
                                                          ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:28:7: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
  if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      ^~~~~~
      buffer
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
                   (char *__restrict buffer, size_t count,
                                     ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:28:14: error: ordered comparison between pointer and zero ('char *' and 'int')
  if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      ~~~~~~ ^ ~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:30:49: error: use of undeclared identifier 'buffsz'
  return (ret < 0 || static_cast<size_t>(ret) > buffsz) ? 0 : ret;
                                                ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:22:53: error: unused parameter 'count' [-Werror,-Wunused-parameter]
                   (char *__restrict buffer, size_t count,
                                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/time/strftime_l.cpp:24:49: error: unused parameter 'tp' [-Werror,-Wunused-parameter]

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 19, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/12827

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[625/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fesetexcept.dir/fesetexcept.cpp.obj
[626/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fesetexceptflag.dir/fesetexceptflag.cpp.obj
[627/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.feholdexcept.dir/feholdexcept.cpp.obj
[628/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.feupdateenv.dir/feupdateenv.cpp.obj
[629/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.obj
[630/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.free.dir/free.cpp.obj
[631/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.aligned_alloc.dir/aligned_alloc.cpp.obj
[632/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.malloc.dir/malloc.cpp.obj
[633/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.calloc.dir/calloc.cpp.obj
[634/2826] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj
FAILED: libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/bin/clang++ --target=armv6m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/runtimes/runtimes-armv6m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=armv6m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj -MF libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj.d -o libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:40: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                        ^~~~~~
      |                                        buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:47: error: ordered comparison between pointer and zero ('char *' and 'int')
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                        ~~~~~~ ^ ~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:53: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                                     ^~~~~~
      |                                                     buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:27:59: error: use of undeclared identifier 'timeptr'
   27 |   int ret = strftime_core::strftime_main(&writer, format, timeptr);
      |                                                           ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:28:7: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   28 |   if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      |       ^~~~~~
      |       buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:28:14: error: ordered comparison between pointer and zero ('char *' and 'int')
   28 |   if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      |       ~~~~~~ ^ ~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:30:49: error: use of undeclared identifier 'buffsz'
   30 |   return (ret < 0 || static_cast<size_t>(ret) > buffsz) ? 0 : ret;
      |                                                 ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:53: error: unused parameter 'count' [-Werror,-Wunused-parameter]
   22 |                    (char *__restrict buffer, size_t count,
      |                                                     ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:24:49: error: unused parameter 'tp' [-Werror,-Wunused-parameter]
Step 6 (build) failure: build (failure)
...
[625/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fesetexcept.dir/fesetexcept.cpp.obj
[626/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fesetexceptflag.dir/fesetexceptflag.cpp.obj
[627/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.feholdexcept.dir/feholdexcept.cpp.obj
[628/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.feupdateenv.dir/feupdateenv.cpp.obj
[629/2826] Building CXX object libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.obj
[630/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.free.dir/free.cpp.obj
[631/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.aligned_alloc.dir/aligned_alloc.cpp.obj
[632/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.malloc.dir/malloc.cpp.obj
[633/2826] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.calloc.dir/calloc.cpp.obj
[634/2826] Building CXX object libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj
FAILED: libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/bin/clang++ --target=armv6m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-e3dpa0gw/runtimes/runtimes-armv6m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=armv6m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj -MF libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj.d -o libc/src/time/CMakeFiles/libc.src.time.strftime_l.dir/strftime_l.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:40: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                        ^~~~~~
      |                                        buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:47: error: ordered comparison between pointer and zero ('char *' and 'int')
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                        ~~~~~~ ^ ~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:25:53: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   25 |   printf_core::WriteBuffer wb(buffer, (buffsz > 0 ? buffsz - 1 : 0));
      |                                                     ^~~~~~
      |                                                     buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:27:59: error: use of undeclared identifier 'timeptr'
   27 |   int ret = strftime_core::strftime_main(&writer, format, timeptr);
      |                                                           ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:28:7: error: use of undeclared identifier 'buffsz'; did you mean 'buffer'?
   28 |   if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      |       ^~~~~~
      |       buffer
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:38: note: 'buffer' declared here
   22 |                    (char *__restrict buffer, size_t count,
      |                                      ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:28:14: error: ordered comparison between pointer and zero ('char *' and 'int')
   28 |   if (buffsz > 0) // if the buffsz is 0 the buffer may be a null pointer.
      |       ~~~~~~ ^ ~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:30:49: error: use of undeclared identifier 'buffsz'
   30 |   return (ret < 0 || static_cast<size_t>(ret) > buffsz) ? 0 : ret;
      |                                                 ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:22:53: error: unused parameter 'count' [-Werror,-Wunused-parameter]
   22 |                    (char *__restrict buffer, size_t count,
      |                                                     ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/time/strftime_l.cpp:24:49: error: unused parameter 'tp' [-Werror,-Wunused-parameter]

petrhosek added a commit that referenced this pull request Feb 19, 2025
@petrhosek petrhosek deleted the libc-strftime_l branch February 19, 2025 08:39
petrhosek added a commit that referenced this pull request Feb 19, 2025
github-actions bot pushed a commit to arm/arm-toolchain that referenced this pull request Feb 19, 2025
Prakhar-Dixit pushed a commit to Prakhar-Dixit/llvm-project that referenced this pull request Feb 19, 2025
This is a (no-op) locale version of strftime.
Prakhar-Dixit pushed a commit to Prakhar-Dixit/llvm-project that referenced this pull request Feb 19, 2025
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.

4 participants