[libc-commits] [libc] [libc]: Implement strfrom* functions and utils (PR #85438)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Fri Mar 15 13:54:51 PDT 2024
================
@@ -0,0 +1,44 @@
+//===-- Implementation of strfromf ------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/stdlib/strfromf.h"
+#include "src/stdlib/str_from_util.h"
+
+#include <stdarg.h>
+#include <stddef.h>
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(int, strfromf,
+ (char *__restrict s, size_t n, const char *__restrict format,
+ float fp)) {
+
+ if (!s)
----------------
michaelrj-google wrote:
I would change this to `LIBC_ASSERT(s != nullptr)`
https://github.com/llvm/llvm-project/pull/85438
More information about the libc-commits
mailing list