* Re: wcwidth broken with gcc 16
[not found] ` <87o6hw23tp.fsf@>
@ 2026-05-31 3:42 ` Brian Inglis
0 siblings, 0 replies; only message in thread
From: Brian Inglis @ 2026-05-31 3:42 UTC (permalink / raw)
To: General Cygwin discussions and problem reports; +Cc: newlib
On 2026-05-30 11:40, ASSI via Cygwin wrote:
> Thomas Wolff via Cygwin writes:
>> The patch is already on the newlib mailing list.
[PATCH] wchar.h: tweak wcwidth prototype parameter wchar_t -> wint_t
> The input parameter is supposed to be wchar_t, not wint_t (per POSIX and
> also the previous implementation), so I'd leave that alone.
>> Yeah, I forgot to type-extend also the include file back in 2018 :-(
>> but that made no difference so far, only now in gcc 16, as explained
>> by Drea in that issue:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125451#c16
>
> Just pun the type in the stub implementation, which would automatically
> happen (I think) since there's already an assignment of the input
> parameter from the POSIX wcwidth (wchar_t) to a local variable that has
> type wint_t. And since that's not a function call but an assignment,
> the promotion rules should be correct for your application without any
> cast.
Both the man doc and definition in newlib/libc/string/wcwidth.c need
wcwidth (wint_t) changed to the POSIX 8 SUS V5 specified wcwidth (wchar_t);
newlib/libc/include/wchar.h is quite correct and okay as is!
https://pubs.opengroup.org/onlinepubs/9799919799/functions/wcwidth.html
The standard definition prohibits WEOF, but allows null, non-spacing, or
printable wide-character codes, corresponding to a valid character in the
current locale, to be passed.
POSIX return codes are defined differently from __wcwidth results.
No errors are defined, and on valid input, errno is not changed.
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-31 3:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <a9676834-0368-4a8a-88b0-da5e9483b536@towo.net>
[not found] ` <874ikpawdk.fsf@Gerda.invalid>
[not found] ` <8ff2ab8d-dfdc-459c-96f3-ed4a4f451440@towo.net>
[not found] ` <0140C1F4-CA22-46DE-AE21-69C5427C59B5@unified-streaming.com>
[not found] ` <e94174b7-ea9b-45ca-bfd3-7979ce988920@towo.net>
[not found] ` <e362b49c-521c-4cd5-8963-c17d5770619b@SystematicSW.ab.ca>
[not found] ` <fbbeb91a-4c5a-dbe6-1bb3-206cf14a73bc@wisemo.com>
[not found] ` <4f885156-7772-43d7-ab72-c88f0a7d1e52@towo.net>
[not found] ` <112594ad-3c25-4dad-b1bc-071b4951ed98@towo.net>
[not found] ` <97f0f3c6-9f2c-429c-aa8e-875b7806b275@towo.net>
[not found] ` <8733z9jpfj.fsf@Gerda.invalid>
[not found] ` <b70d8366-8970-4cdc-a693-6d826fe76277@towo.net>
[not found] ` <87o6hw23tp.fsf@>
2026-05-31 3:42 ` wcwidth broken with gcc 16 Brian Inglis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).