delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/16/05:52:16

Message-ID: <3949F987.B37E0BC4@softhome.net>
Date: Fri, 16 Jun 2000 11:55:20 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.73 [en] (Win98; U)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
CC: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>,
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Subject: Re: Patch: sentinels for typedefs in headers
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10006161124360 DOT 8899-100000 AT acp3bf>
Reply-To: djgpp-workers AT delorie DOT com

Hans-Bernhard Broeker wrote:
> EOF is supposed to be converted to WEOF. At the very least, that's what
> the conversion function, btowc(), is defined to do, by C99. Quoting
> the draft:
> 
>        [#3] The btowc returns WEOF if c has the  value  EOF  or  if
>        (unsigned  char)c  does  not  constitute  a valid (one-byte)
>        multibyte character in the initial shift state.   Otherwise,
>        it   returns   the  wide-character  representation  of  that
>        character.
> 
> Summing up what I read in the (draft) C99 standard, WEOF behaves almost
> exactly the same as EOF, with the only exception that it is not required
> to be negative. And wint_t is for wchar_t what int is for unsigned char: a
> datatype large enough to hold any wide character, plus WEOF. The
> difference is that WEOF is allowed to be within the range of wchar_t, so
> wchar_t and wint_t can be the same.

Ahh, so it's easy to convert wint_t to unsigned and properly convert EOF
to WEOF. So maybe it's OK to change?

Laurynas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019