iswcntrl() regression

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

iswcntrl() regression

Bruno Haible
Hi,

POSIX [1] requires that iswcntrl (EOF) == 0.

This was true in         CYGWIN_NT-10.0 2.9.0(0.318/5/3) (x86_64)
but is no longer true in CYGWIN_NT-10.0 2.11.1(0.329/5/3) (x86_64).
(Reported by Assaf Gordon.)

Looking at the changes that occurred in the cygwin git between
2.9.0 (on 2017-08-03) and 2.11.1 (on 2018-08-31)
it appears to me that the culprit is the commit
41f72ab4d7c404b8ac2a5e1187d79164992e4483 (on 2018-03-09).

I would like to CC its author, Thomas Wolff, but he gave an invalid
email address <[hidden email]> in the commit.

This regression was found by gnulib's test suite
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/test-wctype-h.c

Bruno


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

Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Thomas Wolff
On 19.12.2018 13:53, Bruno Haible wrote:
> Hi,
>
> POSIX [1] requires that iswcntrl (EOF) == 0.
Interesting special case, as EOF is not a character.
In newlib/libc/ctype, this could be fixed in iswcntrl_l.c as a special
condition, or injected as a special case in the categories.t table.
Are there any other special requirements concerning EOF?
Thomas

>
> This was true in         CYGWIN_NT-10.0 2.9.0(0.318/5/3) (x86_64)
> but is no longer true in CYGWIN_NT-10.0 2.11.1(0.329/5/3) (x86_64).
> (Reported by Assaf Gordon.)
>
> Looking at the changes that occurred in the cygwin git between
> 2.9.0 (on 2017-08-03) and 2.11.1 (on 2018-08-31)
> it appears to me that the culprit is the commit
> 41f72ab4d7c404b8ac2a5e1187d79164992e4483 (on 2018-03-09).
>
> I would like to CC its author, Thomas Wolff, but he gave an invalid
> email address <[hidden email]> in the commit.
>
> This regression was found by gnulib's test suite
> https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/test-wctype-h.c
>
> Bruno
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>


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

Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Corinna Vinschen-2
CCed Bruno and Assaf, I guess both are not subscribed to the Cygwin ML.

On Dec 19 14:25, Thomas Wolff wrote:

> On 19.12.2018 13:53, Bruno Haible wrote:
> > Hi,
> >
> > POSIX [1] requires that iswcntrl (EOF) == 0.
> Interesting special case, as EOF is not a character.
> In newlib/libc/ctype, this could be fixed in iswcntrl_l.c as a special
> condition, or injected as a special case in the categories.t table.
> Are there any other special requirements concerning EOF?
> Thomas
>
> >
> > This was true in         CYGWIN_NT-10.0 2.9.0(0.318/5/3) (x86_64)
> > but is no longer true in CYGWIN_NT-10.0 2.11.1(0.329/5/3) (x86_64).
> > (Reported by Assaf Gordon.)
> >
> > Looking at the changes that occurred in the cygwin git between
> > 2.9.0 (on 2017-08-03) and 2.11.1 (on 2018-08-31)
> > it appears to me that the culprit is the commit
> > 41f72ab4d7c404b8ac2a5e1187d79164992e4483 (on 2018-03-09).
> >
> > I would like to CC its author, Thomas Wolff, but he gave an invalid
> > email address <[hidden email]> in the commit.
> >
> > This regression was found by gnulib's test suite
> > https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/test-wctype-h.c
> >
> > Bruno
Thanks for the report, Bruno!


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Bruno Haible
Hello Thomas,

Oops 1: I forgot to add the reference to POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html

Oops 2:
The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).

> > Are there any other special requirements concerning EOF?

WEOF is a special value. The difference between wint_t and wchar_t is
essentially that WEOF fits into wint_t but is not guaranteed to fit in wchar_t.
(Like EOF fits into 'int' but usually does not fit in 'unsigned char'.)

WEOF is special for all functions declared in <wctype.h>, see

http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalnum.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalpha.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswblank.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswdigit.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswgraph.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswlower.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswprint.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswpunct.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswspace.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswupper.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswxdigit.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswctype.html

http://pubs.opengroup.org/onlinepubs/9699919799/functions/towlower.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/towctrans.html

> this could be fixed in iswcntrl_l.c as a special condition, or
> injected as a special case in the categories.t table.

Probably, yes.

Bruno


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

Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Corinna Vinschen-2
On Dec 19 21:57, Bruno Haible wrote:

> Hello Thomas,
>
> Oops 1: I forgot to add the reference to POSIX:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>
> Oops 2:
> The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).
>
> > > Are there any other special requirements concerning EOF?
>
> WEOF is a special value. The difference between wint_t and wchar_t is
> essentially that WEOF fits into wint_t but is not guaranteed to fit in wchar_t.
> (Like EOF fits into 'int' but usually does not fit in 'unsigned char'.)
>
> WEOF is special for all functions declared in <wctype.h>, see
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalnum.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalpha.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswblank.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswdigit.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswgraph.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswlower.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswprint.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswpunct.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswspace.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswupper.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswxdigit.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswctype.html
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towlower.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towctrans.html
>
> > this could be fixed in iswcntrl_l.c as a special condition, or
> > injected as a special case in the categories.t table.
>
> Probably, yes.
Thomas, any input?  Are you going to provide patches?


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Thomas Wolff
Am 06.01.2019 um 21:21 schrieb Corinna Vinschen:

> On Dec 19 21:57, Bruno Haible wrote:
>> Hello Thomas,
>>
>> Oops 1: I forgot to add the reference to POSIX:
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>>
>> Oops 2:
>> The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).
>>
>>>> Are there any other special requirements concerning EOF?
>> WEOF is a special value. The difference between wint_t and wchar_t is
>> essentially that WEOF fits into wint_t but is not guaranteed to fit in wchar_t.
>> (Like EOF fits into 'int' but usually does not fit in 'unsigned char'.)
>>
>> WEOF is special for all functions declared in <wctype.h>, see
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalnum.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalpha.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswblank.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswdigit.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswgraph.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswlower.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswprint.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswpunct.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswspace.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswupper.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswxdigit.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswctype.html
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towlower.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towctrans.html
>>
>>> this could be fixed in iswcntrl_l.c as a special condition, or
>>> injected as a special case in the categories.t table.
>> Probably, yes.
> Thomas, any input?  Are you going to provide patches?
Well, yes, now I'm assuming that this is the only WEOF special case and
I'll look after it this week.
Thomas

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

Reply | Threaded
Open this post in threaded view
|

RE: iswcntrl() regression

Wong, Samuel
In reply to this post by Corinna Vinschen-2
Hi All,

I have tried to unsubscribe from the Cygwin mailing list.

I have tried simple way to unsubscribe by entering Mailing list name, Your email address.  But I cannot find out the mailing list name.
I have read the unsubscribe full, but still cannot find the mailing list name.

Please help to unsubscribe me for all mailing lists with Cygwin.

My email address is [hidden email]



Thanks
Sam.

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Corinna Vinschen
Sent: Wednesday, December 19, 2018 5:37 AM
To: [hidden email]
Cc: Bruno Haible <[hidden email]>; Assaf Gordon <[hidden email]>
Subject: Re: iswcntrl() regression

CCed Bruno and Assaf, I guess both are not subscribed to the Cygwin ML.

On Dec 19 14:25, Thomas Wolff wrote:

> On 19.12.2018 13:53, Bruno Haible wrote:
> > Hi,
> >
> > POSIX [1] requires that iswcntrl (EOF) == 0.
> Interesting special case, as EOF is not a character.
> In newlib/libc/ctype, this could be fixed in iswcntrl_l.c as a special
> condition, or injected as a special case in the categories.t table.
> Are there any other special requirements concerning EOF?
> Thomas
>
> >
> > This was true in         CYGWIN_NT-10.0 2.9.0(0.318/5/3) (x86_64)
> > but is no longer true in CYGWIN_NT-10.0 2.11.1(0.329/5/3) (x86_64).
> > (Reported by Assaf Gordon.)
> >
> > Looking at the changes that occurred in the cygwin git between
> > 2.9.0 (on 2017-08-03) and 2.11.1 (on 2018-08-31) it appears to me
> > that the culprit is the commit
> > 41f72ab4d7c404b8ac2a5e1187d79164992e4483 (on 2018-03-09).
> >
> > I would like to CC its author, Thomas Wolff, but he gave an invalid
> > email address <[hidden email]> in the commit.
> >
> > This regression was found by gnulib's test suite
> > https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/tes
> > t-wctype-h.c
> >
> > Bruno

Thanks for the report, Bruno!


Corinna

--
Corinna Vinschen
Cygwin Maintainer

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

Reply | Threaded
Open this post in threaded view
|

Unsubscribing from Cygwin Mailing List (was: iswcntrl() regression)

Brian Inglis
On 2019-01-08 15:56, Wong, Samuel wrote:
> I have tried to unsubscribe from the Cygwin mailing list.
> I have tried simple way to unsubscribe by entering Mailing list name, Your
> email address.  But I cannot find out the mailing list name.
> I have read the unsubscribe full, but still cannot find the mailing list name.
> Please help to unsubscribe me for all mailing lists with Cygwin.
> My email address is [hidden email]

Mailing list is Cygwin - see:

        https://cygwin.com/lists.html#subscribe-unsubscribe

        https://cygwin.com/ml/#unsubscribe-simple

also mentioned below.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

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

Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Thomas Wolff
In reply to this post by Thomas Wolff
Am 06.01.2019 um 23:39 schrieb Thomas Wolff:

> Am 06.01.2019 um 21:21 schrieb Corinna Vinschen:
>> On Dec 19 21:57, Bruno Haible wrote:
>>> Hello Thomas,
>>>
>>> Oops 1: I forgot to add the reference to POSIX:
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>>>
>>> Oops 2:
>>> The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).
>>>
>>>>> Are there any other special requirements concerning EOF?
>>> WEOF is a special value. The difference between wint_t and wchar_t is
>>> essentially that WEOF fits into wint_t but is not guaranteed to fit
>>> in wchar_t.
>>> (Like EOF fits into 'int' but usually does not fit in 'unsigned char'.)
>>>
>>> WEOF is special for all functions declared in <wctype.h>, see
>>>
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalnum.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswalpha.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswblank.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswdigit.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswgraph.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswlower.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswprint.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswpunct.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswspace.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswupper.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswxdigit.html 
>>>
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswctype.html
>>>
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towlower.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html
>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/towctrans.html 
>>>
>>>
>>>> this could be fixed in iswcntrl_l.c as a special condition, or
>>>> injected as a special case in the categories.t table.
>>> Probably, yes.
>> Thomas, any input?  Are you going to provide patches?
> Well, yes, now I'm assuming that this is the only WEOF special case
> and I'll look after it this week.
> Thomas
The fix should be as attached.
However, I don't seem to be able to produce a git format patch; when I
`git format-patch -1` (after `git pull` and modifying only the affected
file) it produces a patch file

Subject: [PATCH] Cygwin: try_to_bin: don't check recycler filename all
the time
...
Signed-off-by: Corinna Vinschen <[hidden email]>
---
  winsup/cygwin/syscalls.cc | 71 +++++++++++++++++++++------------------
...

which is weird.
Thomas


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

0001-iswcntrl-WEOF.patch (528 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Corinna Vinschen-2
On Jan 11 02:07, Thomas Wolff wrote:

> Am 06.01.2019 um 23:39 schrieb Thomas Wolff:
> > Am 06.01.2019 um 21:21 schrieb Corinna Vinschen:
> > > On Dec 19 21:57, Bruno Haible wrote:
> > > > Hello Thomas,
> > > >
> > > > Oops 1: I forgot to add the reference to POSIX:
> > > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
> > > >
> > > > Oops 2:
> > > > The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).
> > > > [...]
> > > Thomas, any input?  Are you going to provide patches?
> > Well, yes, now I'm assuming that this is the only WEOF special case and
> > I'll look after it this week.
> > Thomas
> The fix should be as attached.
> However, I don't seem to be able to produce a git format patch; when I `git
> format-patch -1` (after `git pull` and modifying only the affected file) it
> produces a patch file
>
> Subject: [PATCH] Cygwin: try_to_bin: don't check recycler filename all the
> time
> ...
> Signed-off-by: Corinna Vinschen <[hidden email]>
> ---
>  winsup/cygwin/syscalls.cc | 71 +++++++++++++++++++++------------------
> ...
>
> which is weird.
No, it's not.  Only commited patches are printed by `git format-patch',
so, after `git pull' you have to *commit* your patches, write a nice
description (with a blank line after the first line to separate the
commit message into synopsis and body).  *Then* call `git format-patch -1'.

Apart from that, please send your patch to the newlib mailing list.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: iswcntrl() regression

Thomas Wolff
Am 11.01.2019 um 10:16 schrieb Corinna Vinschen:

> On Jan 11 02:07, Thomas Wolff wrote:
>> Am 06.01.2019 um 23:39 schrieb Thomas Wolff:
>>> Am 06.01.2019 um 21:21 schrieb Corinna Vinschen:
>>>> On Dec 19 21:57, Bruno Haible wrote:
>>>>> Hello Thomas,
>>>>>
>>>>> Oops 1: I forgot to add the reference to POSIX:
>>>>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iswcntrl.html
>>>>>
>>>>> Oops 2:
>>>>> The relevant expression is iswcntrl (WEOF), not iswcntrl (EOF).
>>>>> [...]
>>>> Thomas, any input?  Are you going to provide patches?
>>> Well, yes, now I'm assuming that this is the only WEOF special case and
>>> I'll look after it this week.
>>> Thomas
>> The fix should be as attached.
>> However, I don't seem to be able to produce a git format patch; when I `git
>> format-patch -1` (after `git pull` and modifying only the affected file) it
>> produces a patch file
>>
>> Subject: [PATCH] Cygwin: try_to_bin: don't check recycler filename all the
>> time
>> ...
>> Signed-off-by: Corinna Vinschen <[hidden email]>
>> ---
>>   winsup/cygwin/syscalls.cc | 71 +++++++++++++++++++++------------------
>> ...
>>
>> which is weird.
> No, it's not.  Only commited patches are printed by `git format-patch',
> so, after `git pull' you have to *commit* your patches, write a nice
> description (with a blank line after the first line to separate the
> commit message into synopsis and body).  *Then* call `git format-patch -1'.
Blush; forgot about the workflow...
> Apart from that, please send your patch to the newlib mailing list.
Done.
Also sent a Unicode 11.0 update patch.
Thomas

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