Re: [PATCH v7 5/6] rust: str: add radix prefixed integer parsing functions

From
Andreas Hindborg <a.hindborg@kernel.org>
Date
2025-02-25 08:08:54
Also in
linux-kbuild, lkml, rust-for-linux
"Miguel Ojeda" [off-list ref] writes:
On Mon, Feb 24, 2025 at 11:30 PM Janne Grunau [off-list ref] wrote:
quoted
The errors go away after exchanging i128 with i64 (while breaking the
parsing for large values).
I don't think we can use 128-bit integers unconditionally for all
architectures (we could eventually get it to work for some though). So
we should do one of the other approaches discussed in the previous
versions, like call into the C one.
I don't want to call into the C functions for this task if I can stay in
safe Rust.

I think I can solve the issue by parsing into a unsigned version of the
integer and then test the sign bit, or compare against the max value for
the signed version.


Best regards,
Andreas Hindborg
Thread (1 message) 1 message, 1 author, last reply 2025-02-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help