History log of /netbsd-src/lib/libc/locale/c8rtomb.c (Results 1 – 9 of 9)
Revision Date Author Comments
# 49c2256c 12-Oct-2024 rillig <rillig@NetBSD.org>

c8rtomb: use uint8_t for 8-bit values

On amd64 at least, uint_fast8_t is an alias to unsigned int, which
produced a lint warning that 'unsigned int << 24' could lose some bits,
when in fact the expr

c8rtomb: use uint8_t for 8-bit values

On amd64 at least, uint_fast8_t is an alias to unsigned int, which
produced a lint warning that 'unsigned int << 24' could lose some bits,
when in fact the expression was 'unsigned char << 24'.

Fixes the last remaining part of PR toolchain/58728.

show more ...


# 51dce3f5 12-Oct-2024 rillig <rillig@NetBSD.org>

c8rtomb: declare array of constants as const

No binary change using GCC, as it had detected that all access to these
arrays was read-only and thus placed them in the read-only section.


# bb01338b 08-Oct-2024 riastradh <riastradh@NetBSD.org>

c16rtomb, c8rtomb: Omit needless casts. Mark remaining lint issues.

These casts were introduced to pacify lint. lint has now been fixed
to handle __SHIFTOUT/__BITS more robustly so some of them ar

c16rtomb, c8rtomb: Omit needless casts. Mark remaining lint issues.

These casts were introduced to pacify lint. lint has now been fixed
to handle __SHIFTOUT/__BITS more robustly so some of them are no
longer needed to pacify lint.

But lint still objects without some semantically unnecessary casts --
mark those.

- In c8rtomb, c32 is guaranteed to be at most 24-bit -- actually, at
most 21-bit -- but I'm not sure how to prove this to lint without a
transitive analysis of the state machine transitions and knowledge
of the only allowed initial state.

- In c16rtomb, the shiftouts are always 9-bit and so the shiftin
should never overflow, but lint hasn't figured this out yet.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb
PR toolchain/58728: __SHIFTIN/__BITS of values in known-limited range
without cast

show more ...


# f8f6ae37 18-Aug-2024 riastradh <riastradh@NetBSD.org>

c8rtomb(3): Nix __CTASSERT after case label.

I put this in to make it (machine-verifiably) clear that zeroing the
state is the same as returning to the initial conversion state, as
the standard requ

c8rtomb(3): Nix __CTASSERT after case label.

I put this in to make it (machine-verifiably) clear that zeroing the
state is the same as returning to the initial conversion state, as
the standard requires, but this is causing build trouble (and will
likely cause more trouble if pulled up) because some definitions of
__CTASSERT make a declaration which is forbidden after a label, so
let's remove it.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

show more ...


# 4a53dcdc 18-Aug-2024 riastradh <riastradh@NetBSD.org>

c8rtomb(3), c16rtomb(3): Fix NUL handling.

PR lib/58615: incomplete c8rtomb, c16rtomb handles NUL termination
wrong


# 4651a634 17-Aug-2024 riastradh <riastradh@NetBSD.org>

libc: Add _l variants of the cNrtomb and mbrtocN functions.

These accept an explicit locale parameter, rather than using the
current locale.

Visible under _NETBSD_SOURCE, not exposed otherwise.

NO

libc: Add _l variants of the cNrtomb and mbrtocN functions.

These accept an explicit locale parameter, rather than using the
current locale.

Visible under _NETBSD_SOURCE, not exposed otherwise.

NOTE: This adds libc symbols. Riding the libc minor bump for the
non-_l variants of these from two days ago -- hope that's not pushing
it too far.

PR lib/58613: c*rtomb, mbrtoc* should have locale-parametric _l
variants

show more ...


# 0d3267e8 17-Aug-2024 christos <christos@NetBSD.org>

pass lint, XXX see lint bug.


# 565f5b16 15-Aug-2024 riastradh <riastradh@NetBSD.org>

c8rtomb(3), mbrtoc8(3): Use namespace.h to get private aliases.

This way applications defining the symbols c32rtomb or mbrtoc32 won't
clobber our private definitions, which are slightly more constra

c8rtomb(3), mbrtoc8(3): Use namespace.h to get private aliases.

This way applications defining the symbols c32rtomb or mbrtoc32 won't
clobber our private definitions, which are slightly more constrained
about their use of mbstate_t than is obvious from the interface
contract.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

show more ...


# c4e44ee2 15-Aug-2024 riastradh <riastradh@NetBSD.org>

libc: New functions c8rtomb(3) and mbrtoc8(3).

New in C23, for converting from UTF-8 to locale-dependent multibyte
sequences (c8rtomb) or vice versa (mbrtoc8), along with the new type
char8_t.

Cond

libc: New functions c8rtomb(3) and mbrtoc8(3).

New in C23, for converting from UTF-8 to locale-dependent multibyte
sequences (c8rtomb) or vice versa (mbrtoc8), along with the new type
char8_t.

Conditional on either:
- _NETBSD_SOURCE
- _ISOC23_SOURCE
- __STDC_VERSION__ >= 202311L

(Riding the libc minor bump from this morning for the UTF-16/UTF-32
versions from C11.)

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

show more ...