Mail Archives: djgpp-workers/2000/06/16/03:49:21
> Date: Thu, 15 Jun 2000 22:05:14 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> > 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.
- Raw text -