Thomas Wolff via Cygwin writes:
>> Which part of "you must not change a standard public API" is unclear to you?
> Who defines that? Reference? After all, it would be a compatible
> extension, not the most unusal thing to do.

It makes a difference on Cygwin because wchar_t and wint_t are not the
same width (and wchar_t is not supposed to be signed anyway even if they
were).

>> Especially when it would make things binary incompatible?
> I don't see any incompatibilites that might arise on cygwin.

Exactly the same one that had you open a bug for gcc: a compiler that
uses wchar_t for the argument does not need to care about any upper bits
left in the register that will go into the function and the function
call (taking a win_t) does.  Whether there actually are any binaries
that have this problem is left as an exercise for the reader, but the
mere possibility for one to exist makes this a no-go.

>> WCHAR_MAX is 0xffffu on Cygwin, so the above is illegal input to wcwidth and 
>> it never worked.
> Well, my proposal was just to make it work. But you may well argue it
> doesn't need to.

Again, there is no existing code that can produce such a result (given
how wchar_t is currently defined and was from the very beginning), so
there is nothing to fix.  And you can't change it without invalidating
existing binaries.

> If you patch wcwidth.c as you suggest, make sure however *not* to
> bit-reduce __wcwidth because that would break wcswidth which must
> continue to work for non-BMP characters passed as surrogate pairs.

Nobody ever suggested that.  IIRC the internal function __wcwidth that
is called through the stub implementation has always been taking a
wint_t.  I don't know if there's a precedent for an additional API
function (most certainly not POSIX) that exists on systems that have the
same characteristics as Windows (and Cygwin) of wchar_t not quite large
enough to fit all codepoints in order to enable that functionality via
either a wint_t or some additional unsigned wchar-like type.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to