Skip to content

[libc++] picolibc: avoid warning in __locale #73937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions libcxx/include/__locale
Original file line number Diff line number Diff line change
Expand Up @@ -452,16 +452,18 @@ public:
#elif defined(_NEWLIB_VERSION)
// Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
typedef char mask;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask cntrl = _C;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask punct = _P;
static const mask xdigit = _X | _N;
static const mask blank = _B;
// In case char is signed, static_cast is needed to avoid warning on
// positive value becomming negative.
static const mask space = static_cast<mask>(_S);
static const mask print = static_cast<mask>(_P | _U | _L | _N | _B);
static const mask cntrl = static_cast<mask>(_C);
static const mask upper = static_cast<mask>(_U);
static const mask lower = static_cast<mask>(_L);
static const mask alpha = static_cast<mask>(_U | _L);
static const mask digit = static_cast<mask>(_N);
static const mask punct = static_cast<mask>(_P);
static const mask xdigit = static_cast<mask>(_X | _N);
static const mask blank = static_cast<mask>(_B);
// mask is already fully saturated, use a different type in regex_type_traits.
static const unsigned short __regex_word = 0x100;
# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
Expand Down