From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public From: seebs@plethora.net (Peter Seebach) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/06 Message-ID: <63sscj$df1$1@darla.visi.com>#1/1 X-Deja-AN: 287443576 References: <34557f2b.1934172@news.mindspring.com> <63r2sv$rgm$1@helios.crest.nt.com> <63rasf$1ug$1@darla.visi.com> <63snhv$i18$1@helios.crest.nt.com> Organization: Plethora Internet NNTP-Posting-Date: 06 Nov 1997 10:48:19 CST Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-06T10:48:19-06:00 List-Id: In article <63snhv$i18$1@helios.crest.nt.com>, Kaz Kylheku wrote: >But what if all the negative values are required to represent data, leaving >no room for EOF? This is the case if an int is one byte wide. The int >is N bits wide and has to represent 2^N different byte values. That >leaves no possible room for the representation of EOF. I'm not sure. My guess is that the implementor is SOL. Hmm. Actually, no, the user is. If you look at the wording on WEOF, it doesn't have to be outside the range of wchar_t, or anything like that - it just has to not be the same as anything in the extended character set. (Oops, silly me, I just looked in the C9X draft.) However, there's no restrictions on EOF, except that it's negative... So, it's perfectly OK for anything not in the basic character set to be equivalent to EOF, and arguably, on a system with unsigned chars as large as ints, it's okay for anything but null bytes to be equivalent to EOF. -s -- seebs@plethora.net -- Speaking for myself. No spam please. Copyright 1997. All rights reserved. This was not written by my cat. C/Unix wizard - send mail for help! -- - More Net, Less Spam!