This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build error for wcwidth and gcvt


On Jul 22 11:46, Thomas Wolff wrote:
> On 22.07.2019 11:04, Corinna Vinschen wrote:
> > On Jul 20 17:50, Kota Uchida wrote:
> > > Hi All,
> > > 
> > > This is my first mail to newlib community.
> > > I've send this mail because I found some build errors
> > > on newlib's master branch.
> > > 
> > > Cygwin: unbreak the build with GCC 7
> > > 6b7723a83032bd355d3c529d957fe209cb35b4d9
> > > 
> > > I encountered 2 errors about wcwidth and gcvt.
> > > I've pushed simple patches to forked repository:
> > > https://github.com/uchan-nos/newlib-cygwin/commits/fix-build
> The first patch is not correct:
> - wcwidth (const wint_t wc)
> + wcwidth (const wchar_t wc)
> 
> Note the manual page.
> Even if you see the wchar_t definition for Linux/POSIX, note that wchar_t
> has 32 bits there.
> On cygwin, however, wchar_t was defined to have only 16 bits, corresponding
> to the Windows UTF-16 encoding.
> The wcwidth parameter type wint_t is needed to support width enquiries for
> non-BMP characters;
> changing it would seriously deprive the function of part of its
> capabilities.
> Thomas

We might need a generic and a Cygwin-specific definition in the source, i.e.

  #ifdef __CYGWIN__
  use wint_t
  #else
  use wchar_t
  #endif

The header should be kept untouched, of course.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]