[libc-commits] [libc] 7616145 - [libc] Fix type signature for strlcpy and strlcat (#104643)
via libc-commits
libc-commits at lists.llvm.org
Sat Aug 17 07:49:09 PDT 2024
Author: Joseph Huber
Date: 2024-08-17T09:49:05-05:00
New Revision: 76161451f5ca837b25769c7d142f8271b45d9b28
URL: https://github.com/llvm/llvm-project/commit/76161451f5ca837b25769c7d142f8271b45d9b28
DIFF: https://github.com/llvm/llvm-project/commit/76161451f5ca837b25769c7d142f8271b45d9b28.diff
LOG: [libc] Fix type signature for strlcpy and strlcat (#104643)
Summary:
These should not be const on the destination pointer.
Added:
Modified:
libc/newhdrgen/yaml/string.yaml
libc/spec/bsd_ext.td
Removed:
################################################################################
diff --git a/libc/newhdrgen/yaml/string.yaml b/libc/newhdrgen/yaml/string.yaml
index 387ea9ec4e1422..1d6e64bfb9cf60 100644
--- a/libc/newhdrgen/yaml/string.yaml
+++ b/libc/newhdrgen/yaml/string.yaml
@@ -181,7 +181,7 @@ functions:
- BSDExtensions
return_type: size_t
arguments:
- - type: const char *__restrict
+ - type: char *__restrict
- type: const char *__restrict
- type: size_t
- name: strlcpy
@@ -189,7 +189,7 @@ functions:
- BSDExtensions
return_type: size_t
arguments:
- - type: const char *__restrict
+ - type: char *__restrict
- type: const char *__restrict
- type: size_t
- name: strlen
diff --git a/libc/spec/bsd_ext.td b/libc/spec/bsd_ext.td
index 4d33313521735e..2b91324e36db9a 100644
--- a/libc/spec/bsd_ext.td
+++ b/libc/spec/bsd_ext.td
@@ -20,12 +20,12 @@ def BsdExtensions : StandardSpec<"BSDExtensions"> {
FunctionSpec<
"strlcat",
RetValSpec<SizeTType>,
- [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
+ [ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
>,
FunctionSpec<
"strlcpy",
RetValSpec<SizeTType>,
- [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
+ [ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
>,
FunctionSpec<
"strsep",
More information about the libc-commits
mailing list