[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] iscntrl(EOF)
- To: Andreas Schwab <schwab@suse.de>
- Subject: Re: [MiNT] iscntrl(EOF)
- From: Guido Flohr <gufl0000@stud.uni-sb.de>
- Date: Fri, 3 Mar 2000 16:11:09 +0100
- Cc: MiNT mailing list <mint@fishpool.com>
- In-reply-to: <200002281428.PAA27026@hawking.suse.de>; from Andreas Schwab on Mon, Feb 28, 2000 at 03:28:29PM +0100
- References: <20000227002312.A283@stud> <200002281428.PAA27026@hawking.suse.de>
- Sender: owner-mint@fishpool.com
Hi,
sorry for the delay. I was away again.
On Mon, Feb 28, 2000 at 03:28:29PM +0100, Andreas Schwab wrote:
> Guido Flohr <gufl0000@stud.uni-sb.de> writes:
>
> |> Hi,
> |>
> |> in the absence of any reliable C reference I can only guess what
> |> "iscntrl (EOF)" should return. IMHO EOF should be classified as a control
> |> character in the C locale. The GNU libc says it isn't a control
> |> character.
> |>
> |> Could anybody check that either in the standard or on other platforms?
>
> ISO C says that the domain of the <ctype.h> functions is
> UCHAR_MIN..UCHAR_MAX + EOF. They all shall return false for EOF, since
> that is not a character and thus cannot have any of the tested properties.
Does ISO C explicitely say that is*(EOF) should always return zero?
If so I would have to surrender and arrange for EOF not being a control
character whereas 255 (UCHAR_MAX) would be one. But I don't like that
because a construct like
if (iscntrl (c))
cast_it ();
would fail then for c == EOF. I would rather define a control character
as any non-printable character and since EOF is inside the domain of the
ctype function it should also be regarded as a character.
Ciao
Guido
P.S.: Apart from that undecided case iscntrl(EOF) all <ctype.h>
functions/macros now work reliably in the range CHAR_MIN...UCHAR_MAX.
--
http://stud.uni-sb.de/~gufl0000/
mailto:guido@freemint.de