<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/stdio/printf_core/parser.h, branch users/nico/python-2</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 libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)</title>
<updated>2025-06-11T20:25:27+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-11T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d87eea35fac5a34a841c637db8908128409a184e'/>
<id>d87eea35fac5a34a841c637db8908128409a184e</id>
<content type='text'>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add `-Wno-sign-conversion` &amp; re-attempt `-Wconversion` (#129811)</title>
<updated>2025-03-10T15:57:09+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-03-10T15:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=257e48371546f75623482071fc39eef4b64fbd88'/>
<id>257e48371546f75623482071fc39eef4b64fbd88</id>
<content type='text'>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relates to
https://github.com/llvm/llvm-project/issues/119281#issuecomment-2699470459</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc]  Enable -Wconversion for tests. (#127523)"</title>
<updated>2025-03-05T21:42:40+00:00</updated>
<author>
<name>Augie Fackler</name>
<email>augie@google.com</email>
</author>
<published>2025-03-05T18:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b'/>
<id>da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b</id>
<content type='text'>
This reverts commit 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 because it
changed the 1st parameter of adjust() to be unsigned, but libc itself
calls adjust() with a negative argument in align_backward() in
op_generic.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 because it
changed the 1st parameter of adjust() to be unsigned, but libc itself
calls adjust() with a negative argument in align_backward() in
op_generic.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc]  Enable -Wconversion for tests. (#127523)</title>
<updated>2025-03-04T15:24:35+00:00</updated>
<author>
<name>Vinay Deshmukh</name>
<email>32487576+vinay-deshmukh@users.noreply.github.com</email>
</author>
<published>2025-03-04T15:24:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1e6e845d49a336e9da7ca6c576ec45c0b419b5f6'/>
<id>1e6e845d49a336e9da7ca6c576ec45c0b419b5f6</id>
<content type='text'>
Relates to: #119281</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relates to: #119281</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix %m on CPUs with float128 but no int128 (#110053)</title>
<updated>2024-09-25T22:30:47+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2024-09-25T22:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eab63b5a8cf2214ddfee566a87deb3013ffcc362'/>
<id>eab63b5a8cf2214ddfee566a87deb3013ffcc362</id>
<content type='text'>
This bug is caused by the BigInt implementation failing to initialize
from errno. Explanation below, but the fix is a static cast to int.

The bug only shows up on risc-v 32 because of a chain of type-oddities:
1) Errno is provided by a struct with an implicit cast to int.
2) The printf parser uses an int128 to store the value of a conversion
   on systems with long double greater than double.
3) On systems without native int128 support we use our own BigInt
instead.

These combine such that if both long double and int128 exist (e.g. on
x86) there's no issue, errno is implicitly cast to int, which is
extended to int128. If long double is double (e.g. on arm32) then int64
is used in the printf parser, the implicit cast works, and there's no
issue. The only way this would come up is if the target has a proper
long double type, but not int128, which is the case for at least the
current risc-v 32 bot.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bug is caused by the BigInt implementation failing to initialize
from errno. Explanation below, but the fix is a static cast to int.

The bug only shows up on risc-v 32 because of a chain of type-oddities:
1) Errno is provided by a struct with an implicit cast to int.
2) The printf parser uses an int128 to store the value of a conversion
   on systems with long double greater than double.
3) On systems without native int128 support we use our own BigInt
instead.

These combine such that if both long double and int128 exist (e.g. on
x86) there's no issue, errno is implicitly cast to int, which is
extended to int128. If long double is double (e.g. on arm32) then int64
is used in the printf parser, the implicit cast works, and there's no
issue. The only way this would come up is if the target has a proper
long double type, but not int128, which is the case for at least the
current risc-v 32 bot.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf strerror conversion (%m) (#105891)</title>
<updated>2024-09-19T17:48:08+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2024-09-19T17:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f009f72df5285acab0ebb600636653d7db72a552'/>
<id>f009f72df5285acab0ebb600636653d7db72a552</id>
<content type='text'>
This patch adds the %m conversion to printf, which prints the
strerror(errno). Explanation of why is below, this patch also updates
the docs, tests, and build system to accomodate this.

The standard for syslog in posix specifies it uses the same format as
printf, but adds %m which prints the error message string for the
current value of errno. For ease of implementation, it's standard
practice for libc implementers to just add %m to printf instead of
creating a separate parser for syslog.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the %m conversion to printf, which prints the
strerror(errno). Explanation of why is below, this patch also updates
the docs, tests, and build system to accomodate this.

The standard for syslog in posix specifies it uses the same format as
printf, but adds %m which prints the error message string for the
current value of errno. For ease of implementation, it's standard
practice for libc implementers to just add %m to printf instead of
creating a separate parser for syslog.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Clean up remaining use of *_WIDTH macros in printf (#102679)</title>
<updated>2024-08-09T20:46:49+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>mcgrathr@google.com</email>
</author>
<published>2024-08-09T20:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6e8a751ef124465b6e05ace84c3d69c0166151c8'/>
<id>6e8a751ef124465b6e05ace84c3d69c0166151c8</id>
<content type='text'>
The previous change missed the second spot doing the same thing.

Bug: https://issues.fuchsia.dev/358196552</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous change missed the second spot doing the same thing.

Bug: https://issues.fuchsia.dev/358196552</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix use of cpp::numeric_limits&lt;...&gt;::digits (#102674)</title>
<updated>2024-08-09T20:09:23+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>mcgrathr@google.com</email>
</author>
<published>2024-08-09T20:09:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a21cf5663c3e757e98a396e47471af63bd4955b0'/>
<id>a21cf5663c3e757e98a396e47471af63bd4955b0</id>
<content type='text'>
The previous change replaced INT_WIDTH with
cpp::numberic_limits&lt;int&gt;::digits, but these don't have the same
value.  While INT_WIDTH == UINT_WIDTH, not so for ::digits, so
use cpp::numberic_limits&lt;unsigned int&gt;::digits et al instead for
the intended effects.

Bug: https://issues.fuchsia.dev/358196552</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous change replaced INT_WIDTH with
cpp::numberic_limits&lt;int&gt;::digits, but these don't have the same
value.  While INT_WIDTH == UINT_WIDTH, not so for ::digits, so
use cpp::numberic_limits&lt;unsigned int&gt;::digits et al instead for
the intended effects.

Bug: https://issues.fuchsia.dev/358196552</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Use cpp::numeric_limits in preference to C23 &lt;limits.h&gt; macros (#102665)</title>
<updated>2024-08-09T19:44:40+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>mcgrathr@google.com</email>
</author>
<published>2024-08-09T19:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2f6a879790d0496375bb9ab5351c9b61058473e8'/>
<id>2f6a879790d0496375bb9ab5351c9b61058473e8</id>
<content type='text'>
This updates some code to consistently use cpp::numeric_limits,
the src/__support polyfill for std::numeric_limits, rather than
the C &lt;limits.h&gt; macros.  This is in keeping with the general
C++-oriented style in libc code, and also sidesteps issues about
the new C23 *_WIDTH macros that the compiler-provided header does
not define outside C23 mode.

Bug: https://issues.fuchsia.dev/358196552</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This updates some code to consistently use cpp::numeric_limits,
the src/__support polyfill for std::numeric_limits, rather than
the C &lt;limits.h&gt; macros.  This is in keeping with the general
C++-oriented style in libc code, and also sidesteps issues about
the new C23 *_WIDTH macros that the compiler-provided header does
not define outside C23 mode.

Bug: https://issues.fuchsia.dev/358196552</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix printf handling of INT_MIN width (#101729)</title>
<updated>2024-08-02T20:45:54+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2024-08-02T20:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a21fc4c0a681000c23089301e8935f579517b96a'/>
<id>a21fc4c0a681000c23089301e8935f579517b96a</id>
<content type='text'>
Prevously, if INT_MIN was passed as a wildcard width to a printf
conversion the parser would attempt to negate it to get the positive
width (and set the left justify flag), but it would underflow and the
width would be treated as 0. This patch corrects the issue by instead
treating a width of INT_MIN as identical to -INT_MAX.

Also includes docs changes to explain this behavior and adding b to the
list of int conversions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevously, if INT_MIN was passed as a wildcard width to a printf
conversion the parser would attempt to negate it to get the positive
width (and set the left justify flag), but it would underflow and the
width would be treated as 0. This patch corrects the issue by instead
treating a width of INT_MIN as identical to -INT_MAX.

Also includes docs changes to explain this behavior and adding b to the
list of int conversions.</pre>
</div>
</content>
</entry>
</feed>
