<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/wchar, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Move mbtowc, mbstowcs and inverse functions to stdlib.h (#168455)</title>
<updated>2025-11-17T23:43:42+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-17T23:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da61dd28c6dd77901058580e391cb8c88bb506f2'/>
<id>da61dd28c6dd77901058580e391cb8c88bb506f2</id>
<content type='text'>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Implement wcstod and wcstold. (#168020)</title>
<updated>2025-11-17T21:42:12+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-17T21:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=92c8c87c49100e3f14e3ec46abf47f27191f8b53'/>
<id>92c8c87c49100e3f14e3ec46abf47f27191f8b53</id>
<content type='text'>
These are simply implemented as specializations of strtofloatingpoint
for double / long double and for wchar_t. The unit tests are copied from
the strtod / strtold ones.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are simply implemented as specializations of strtofloatingpoint
for double / long double and for wchar_t. The unit tests are copied from
the strtod / strtold ones.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Templatize strtofloatingpoint and implement wcstof. (#167755)</title>
<updated>2025-11-13T19:38:33+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-13T19:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e797ec64768d290427e4f2545f1ae42302d7cfaa'/>
<id>e797ec64768d290427e4f2545f1ae42302d7cfaa</id>
<content type='text'>
This change follows the pattern of
315dfe5865962d8a3d60e21d1fffce5214fe54ef by making strtofloat also
accept wchar_t* strings
(in addition to regular char*). It uses overloads from wctype_utils or
specialized functions to ensure comparison with literal characters (or
literal strings) pick char or wchar_t variants based on the argument
type.

The wcstof implementation is added, with unit test cases copied from
strtof test suite.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change follows the pattern of
315dfe5865962d8a3d60e21d1fffce5214fe54ef by making strtofloat also
accept wchar_t* strings
(in addition to regular char*). It uses overloads from wctype_utils or
specialized functions to ensure comparison with literal characters (or
literal strings) pick char or wchar_t variants based on the argument
type.

The wcstof implementation is added, with unit test cases copied from
strtof test suite.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Templatize strtointeger implementation. (#165884)</title>
<updated>2025-10-31T18:57:08+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-10-31T18:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=315dfe5865962d8a3d60e21d1fffce5214fe54ef'/>
<id>315dfe5865962d8a3d60e21d1fffce5214fe54ef</id>
<content type='text'>
* Removes the copy-pasta implementation of wcstointeger,
  and migrate the wcsto* family of functions to use a template
  version of strtointeger.
* Fixes the out-of-bound read in the original implementation(s)
  when the entire input string consists of whitespaces
  (then the sign check can access OOB memory)

The code is currently slightly peppered with "if constexpr" statements
to distinguish between char and wchar_t. We can probably
simplify it in subsequent changes by:
* using overrides, so that internal::isalnum() is overriden for
  both char and wchar_t (since C++ luckily allows us to reuse names).
* this wouldn't help for direct comparison with literals -
for this as a somewhat ugly workaround like is_char_literal(c, '0',
L'0')</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Removes the copy-pasta implementation of wcstointeger,
  and migrate the wcsto* family of functions to use a template
  version of strtointeger.
* Fixes the out-of-bound read in the original implementation(s)
  when the entire input string consists of whitespaces
  (then the sign check can access OOB memory)

The code is currently slightly peppered with "if constexpr" statements
to distinguish between char and wchar_t. We can probably
simplify it in subsequent changes by:
* using overrides, so that internal::isalnum() is overriden for
  both char and wchar_t (since C++ luckily allows us to reuse names).
* this wouldn't help for direct comparison with literals -
for this as a somewhat ugly workaround like is_char_literal(c, '0',
L'0')</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix a couple issues in &lt;wchar.h&gt; header (#164666)</title>
<updated>2025-10-22T18:09:42+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-10-22T18:09:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9fc353ee36d646ed0dc609734a364437265ec374'/>
<id>9fc353ee36d646ed0dc609734a364437265ec374</id>
<content type='text'>
* Add FILE type declaration, as it should be presented in `&lt;wchar.h&gt;`,
as well as in `&lt;stdio.h&gt;`
* Fix argument type in `wcsrtombs` / `wcsnrtombs` function - it should
be restrict pointer to `mbstate_t`. Add restrict qualifier to internal
implementation as well.

This brings us closer to being able to build libcxx with wide-character
support against llvm-libc headers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add FILE type declaration, as it should be presented in `&lt;wchar.h&gt;`,
as well as in `&lt;stdio.h&gt;`
* Fix argument type in `wcsrtombs` / `wcsnrtombs` function - it should
be restrict pointer to `mbstate_t`. Add restrict qualifier to internal
implementation as well.

This brings us closer to being able to build libcxx with wide-character
support against llvm-libc headers.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Change __builtin_memcpy to inline_memcpy. (#158345)</title>
<updated>2025-09-12T21:57:08+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-09-12T21:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f019e2368b137371d248a7ddbe37f76466c2d44d'/>
<id>f019e2368b137371d248a7ddbe37f76466c2d44d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Refactor libc code to improve readability. (#153308)</title>
<updated>2025-08-13T04:41:21+00:00</updated>
<author>
<name>Jin Huang</name>
<email>jinhuang1102@gmail.com</email>
</author>
<published>2025-08-13T04:41:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=91de0a2c439ce3d77639a6b8ce8eda5089307392'/>
<id>91de0a2c439ce3d77639a6b8ce8eda5089307392</id>
<content type='text'>
The PR is going to improve the readability for the files under
`llvm-project/libc/src/wchar` directory.

---------

Co-authored-by: Jin Huang &lt;jingold@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The PR is going to improve the readability for the files under
`llvm-project/libc/src/wchar` directory.

---------

Co-authored-by: Jin Huang &lt;jingold@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix wcstok() "subsequent searches" behavior. (#151589)</title>
<updated>2025-08-01T18:15:34+00:00</updated>
<author>
<name>enh-google</name>
<email>enh@google.com</email>
</author>
<published>2025-08-01T18:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b36f05ce48bd714182481765ac14fcaff129639f'/>
<id>b36f05ce48bd714182481765ac14fcaff129639f</id>
<content type='text'>
POSIX says "If no such wide-character code is found, the current token
extends to the end of the wide-character string pointed to by ws1, and
subsequent searches for a token shall return a null pointer", but the
current implementation only returns nullptr the first time. This failed
an existing bionic test when I tried to switch over to llvm-libc
wcstok().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
POSIX says "If no such wide-character code is found, the current token
extends to the end of the wide-character string pointed to by ws1, and
subsequent searches for a token shall return a null pointer", but the
current implementation only returns nullptr the first time. This failed
an existing bionic test when I tried to switch over to llvm-libc
wcstok().</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Reland wchar string conversion mb to wc (#151048)</title>
<updated>2025-07-29T16:34:10+00:00</updated>
<author>
<name>sribee8</name>
<email>sriya.pratipati@gmail.com</email>
</author>
<published>2025-07-29T16:34:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a653934b581b2132b1f67ddfb304d5f12681180d'/>
<id>a653934b581b2132b1f67ddfb304d5f12681180d</id>
<content type='text'>
Added crash on nullptr to mbstowcs

---------

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added crash on nullptr to mbstowcs

---------

Co-authored-by: Sriya Pratipati &lt;sriyap@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Correct include path for wchar_utils.h in libc/src/wchar/wcspbrk.cpp (#151059)</title>
<updated>2025-07-29T01:14:14+00:00</updated>
<author>
<name>Jin Huang</name>
<email>jinhuang1102@gmail.com</email>
</author>
<published>2025-07-29T01:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d05e55f69426c38f42f911a11ac540896577e06'/>
<id>0d05e55f69426c38f42f911a11ac540896577e06</id>
<content type='text'>
A previous change incorrectly included `wchar_util.h` using a broken
relative path. This change corrects the path to `#include
"src/wchar/wchar_utils.h"`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A previous change incorrectly included `wchar_util.h` using a broken
relative path. This change corrects the path to `#include
"src/wchar/wchar_utils.h"`.</pre>
</div>
</content>
</entry>
</feed>
