https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125451

ASSI <Stromeko at nexgo dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Stromeko at nexgo dot de

--- Comment #17 from ASSI <Stromeko at nexgo dot de> ---
This seems to be a newlib-cygwin bug.  Correctly per POSIX

newlib/libc/include/wchar.h:int wcwidth (const wchar_t);

but the implementation stub then is

newlib/libc/string/local.h:int __wcwidth (wint_t);
newlib/libc/string/wcwidth.c:__wcwidth (const wint_t ucs)
newlib/libc/string/wcwidth.c:wcwidth (const wint_t wc)
newlib/libc/string/wcwidth.c:  return __wcwidth (wi);

This was changed from wchar_t to wint_t in 2018 with

8e8fd6c84 * use generated width data

authored by none other than Thomas Wolff.  :-)

That moved the type extension to the function argument I think, so I guess if
the signature for the wcwidth argument is corrected to wchar_t then the
assignment

  wint_t wi = wc;

would correctly zero-extend, givent the typedefs.

Reply via email to