Message-Id: <200006160747.KAA21364@alpha.netvision.net.il> Date: Fri, 16 Jun 2000 10:50:07 +0200 X-Mailer: Emacs 20.6 (via feedmail 8.1.emacs20_6 I) and Blat ver 1.8.5b From: "Eli Zaretskii" To: lauras AT softhome DOT net CC: djgpp-workers AT delorie DOT com In-reply-to: <394936FA.392AAB79@softhome.net> (message from Laurynas Biveinis on Thu, 15 Jun 2000 22:05:14 +0200) Subject: Re: Patch: sentinels for typedefs in headers References: <3948E86E DOT E28D1AE8 AT softhome DOT net> <200006151855 DOT VAA06521 AT mailgw1 DOT netvision DOT net DOT il> <394936FA DOT 392AAB79 AT softhome DOT net> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 15 Jun 2000 22:05:14 +0200 > From: Laurynas Biveinis > > > Now, imagine that a character is read from a file (via `getc', say), > > and then is passed through `mbtowc'. What bothers me is this: what > > happens if `getc' returned EOF? I don't have the standard handy, but > > isn't EOF supposed to be converted to WEOF? If it is, we may have > > problem with mixing signed and unsigned. > > Are you speaking about wide character support in C90 or its amendment in '94 > and C99, or both? All of the above, I guess. > If I understand it correctly, putting int returned by getc() somewhere in > char[] to pass to mbtowc is not good idea. I don't think it should be > somehow specially handled - if binary represention of EOF happens to map > somewhere in multibyte char space, let it be. This issue really is (will be) relevant in wgetc and other wide-character I/O functions which we currently don't have. If EOF is not supposed to be converted into WEOF, then perhaps there's no problem. I'm just worried that we are making decisions based on code that was not yet written (the wide-character support), and which it might be difficult to revert later. Perhaps we should leave wint_t alone, for the moment.