NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/47602 (getwc() modifies input instead of returning EILSEQ.)



The following reply was made to PR lib/47602; it has been noted by GNATS.

From: yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi)
To: christos%zoulas.com@localhost
Cc: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
netbsd-bugs%netbsd.org@localhost,
        gnats-admin%netbsd.org@localhost, yamt%NetBSD.org@localhost
Subject: Re: lib/47602 (getwc() modifies input instead of returning EILSEQ.)
Date: Tue, 21 Jan 2014 02:07:18 +0000 (UTC)

 > On Jan 21, 12:29am, yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi) 
 > wrote:
 > -- Subject: Re: lib/47602 (getwc() modifies input instead of returning EILSEQ
 > 
 > | my question was about the test program in this PR, not t_io.
 > 
 > 
 > The program expects to be able to read the data it wrote to the file.
 > I.e. if you getwc() from a file, the character you read should match
 > the sequence of bytes you read. This assumes that there is a 1<->1 mapping
 > from wchar_t to wint_t. Isn't that true?
 
 do you mean to expect the "c == obuf[i]" test always true?
 
 you should read the same byte sequences but wchar_t values corresponding
 to the byte sequence is locale dependent.
 
 while obuf[] is wchar_t for big5 locale (right?), what getwc returns
 is wchar_t for another locale.  comparing them with "==" doesn't make
 much sense.
 
 (i'm not sure about the intention of the mixed use of getwc and getc
 in the program, though.)
 
 YAMAMOTO Takashi
 
 > 
 > christos
 


Home | Main Index | Thread Index | Old Index