On Tue, Nov 15, 2022 at 5:27 AM LIU Hao <[email protected]> wrote:

> 在 2022/11/14 05:48, Martin Storsjö 写道:
> >> -#ifdef _MBCS
> >
> > The existing code checked the flag _MBCS here. I don't see anything in
> mingw-w64 setting this flag
> > (nothing in headers, nothing in crt makefiles). I also grepped through
> both GCC and Clang source,
> > and there's no mentions of this define anywhere there either, so it
> doesn't seem to be predefined by
> > the compiler.
> >
> > Thus, I would think that this codepath isn't actually in use. So
> therefore, changing it into
> > "#ifndef _UNICODE" is a functional change here.
> >
> > The change is probably benign/beneficial though, but it would be good to
> separate out such funtional
> > changes and/or acknowledge them clearly.
> >
>
> In GBK (.936 for Simplified Chinese) [1], Big5 (.950 for Traditional
> Chinese) [2] and Shift JIS
> (.932 for Japanese) [3], the second byte of a double-byte sequence is
> always within the range
> [0x40,0x7E] union [0x80,0xFE], and cannot match an ASCII double-quote
> character (0x22). So i suspect
> the code path was unused and practically never caused any problems. But I
> think it's not a
> functional change; it's just an oversight that used to work by accident.


Right - I mainly meant functional change as it does run slightly different
logic, even if the end result turns out to be the same for all practical
inputs.

I guess it's fine to not make a big fuss about it, but it would be nice to
at least mention it in the commit message, that this enables
previously-dead code.

I included these patches in my nightly builds, and I haven't run into any
surprises there yet, so it's probably fine from that point of view too.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to