[libcxx-commits] [libcxx] [libc++] Add a missing include in string.h (PR #135134)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 18 08:25:34 PDT 2026


https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/135134

>From e9ca7efd611a41316f22035e05a8903593aa3624 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Thu, 10 Apr 2025 15:33:04 +0900
Subject: [PATCH 1/2] [libc++] Add a missing include in string.h

`stddef.h` is necessary for `size_t`.
---
 libcxx/include/string.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libcxx/include/string.h b/libcxx/include/string.h
index 6bdcd6a6eecbd..c61fda32d76f8 100644
--- a/libcxx/include/string.h
+++ b/libcxx/include/string.h
@@ -64,6 +64,8 @@ size_t strlen(const char* s);
 #    include_next <string.h>
 #  endif
 
+#  include <stddef.h> 
+
 // MSVCRT, GNU libc and its derivates may already have the correct prototype in
 // <string.h>. This macro can be defined by users if their C library provides
 // the right signature.

>From 88c959fd83fed57bbea44eeecbc55edf7a7b738f Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Thu, 10 Apr 2025 15:41:04 +0900
Subject: [PATCH 2/2] Remove a trailing space

---
 libcxx/include/string.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/string.h b/libcxx/include/string.h
index c61fda32d76f8..2ffcb913010b6 100644
--- a/libcxx/include/string.h
+++ b/libcxx/include/string.h
@@ -64,7 +64,7 @@ size_t strlen(const char* s);
 #    include_next <string.h>
 #  endif
 
-#  include <stddef.h> 
+#  include <stddef.h>
 
 // MSVCRT, GNU libc and its derivates may already have the correct prototype in
 // <string.h>. This macro can be defined by users if their C library provides



More information about the libcxx-commits mailing list