From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14061 invoked from network); 4 Feb 2022 17:45:38 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Feb 2022 17:45:38 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 173D19D7BE; Sat, 5 Feb 2022 03:45:11 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id D66849CA8D; Sat, 5 Feb 2022 03:44:30 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CCcer14Y"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 058A295192; Sat, 5 Feb 2022 03:44:13 +1000 (AEST) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by minnie.tuhs.org (Postfix) with ESMTPS id 9C08595111 for ; Sat, 5 Feb 2022 03:44:11 +1000 (AEST) Received: by mail-oi1-f169.google.com with SMTP id 4so9288101oil.11 for ; Fri, 04 Feb 2022 09:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=D4geGSedgtdoiTNWOZ++596SW5hL8PiLio+jhRwozho=; b=CCcer14YX5LoYcHkQsJsBQvWrPLderZrmxG3N6WxuBMEUlmpHsUJ4osvHy4gaE7hVr kUuS19QYT1192ACBxgPhKUHSFyo00KA5W2mmG9x1Kb75hn2YH9McX38xghNSptOVJLw5 +0Zy+dmbxiv5SWenLP9eRHaMJOMjisQSSO/HQrVfylDiCCFEf1qOlA50whsfw31kdvA/ 1orVWTjo6uO/kgjr4Zd5YzchA99qDtLC+XAm/xM5lB4GCWtsfZ/UU60CQoVWz0apT7YE 0zDUya3hcFgs3cUyt6IMNYFmcqS0r7YaNhRplPOBa3ZgILbZf6RwfRLxpF8ax1+Wi/83 N40g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=D4geGSedgtdoiTNWOZ++596SW5hL8PiLio+jhRwozho=; b=5rTa8gTTv+Vxtb1yj7T7RSgcif7w0xXAxiWpFegkZTRL24028vctbKTEtGJypDgdS+ yFy6ZIy9CU3fYRHVv99lnMWbx0JRQZ6kkBYmh4csngTQbh2+N7ZPkSMsCvPz17g4/HmX oYUFAfmxSCFt2hpCS/JCuj9fCjdlxhL6NvAVvI/Rb/0ewuPT1E3/OkCh3hKAwoc2YYQF QxGUGNo17RWZP53QLV6S/hcKJ3fx1oE2RFKqMoqpbpGhCZKcJnbE76X3CfRbb5TpNd87 xcS/H3bLTtzhh3Xm7U4qINejVvaq8/T/u0pMGquJIdKDtytAVenj2HdUDdy9iG7f2hp7 Gwfg== X-Gm-Message-State: AOAM532Vmx1n1byosvEUydgk/heiR5veONKkRZBipoHKdyViGGDA8Da7 uzFMbWi3/ba08PIWW3F2+0M= X-Google-Smtp-Source: ABdhPJzPXNMQ/kumAcd+hULuLvRXKMmhRKnstxInAJYsD4v/MejEDgAZ+ViJyw5qAAeCuVEc6CyT6w== X-Received: by 2002:a05:6808:211e:: with SMTP id r30mr1944205oiw.6.1643996650974; Fri, 04 Feb 2022 09:44:10 -0800 (PST) Received: from [192.168.1.215] (035-134-121-000.res.spectrum.com. [35.134.121.0]) by smtp.gmail.com with ESMTPSA id cv13sm752300oab.7.2022.02.04.09.44.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Feb 2022 09:44:10 -0800 (PST) Content-Type: multipart/alternative; boundary="------------P00oIwM2c1UeH0709OOBTC2c" Message-ID: Date: Fri, 4 Feb 2022 11:44:09 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Content-Language: en-US To: Adam Thornton , Ori Idan , The Eunuchs Hysterical Society References: From: Will Senn In-Reply-To: Subject: Re: [TUHS] ratfor vibe X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" This is a multi-part message in MIME format. --------------P00oIwM2c1UeH0709OOBTC2c Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/4/22 11:35 AM, Adam Thornton wrote: > > > On Thu, Feb 3, 2022 at 11:07 PM Ori Idan wrote: > > As for EOF it is 0xFF which is not always -1, depending if your > char is signed or unsigned. > > > Ha!  You fell into my trap!  getc() returns an int!  (I don't know if > EOF is _always_ "all bits set", and even if it is, that's only -1 on a > twos-complement machine, if we want to head off into some real > pedantry...) > > The need to use feof() and ferror() at least appear in the BUGS > section on my Mac.  Linux is not so gracious.  The real bug, if you > ask me, which no one did, is that getc() and pals return an int rather > than a char, which is surprising and certainly has tripped me up > several times across the decades (and yes, I understand that since any > character value is a legal character to have gotten, you need some > other way of signalling an error). This is prolly why the authors steadfastly refused to commit to a particular value for EOF. Instead, they said in essence, that it was a matter of agreement, convention, if you will, and that whatever value was chosen, it should NEVER be a legal character. I made it -1, for v7, cuz it worked... and I wanted so badly to get a working ratfor program that I sacrificed any semblance of technical rigor to make it copy a character, onscreen, in real time, live. Heck, and it only took me a couple of days to figure out all how to get it working, EOF was easy, STDIN and STDOUT, not so much. --------------P00oIwM2c1UeH0709OOBTC2c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2/4/22 11:35 AM, Adam Thornton wrote:


On Thu, Feb 3, 2022 at 11:07 PM Ori Idan <ori@heliconbooks.com> wrote:
As for EOF it is 0xFF which is not always -1, depending if your char is signed or unsigned.


Ha!  You fell into my trap!  getc() returns an int!  (I don't know if EOF is _always_ "all bits set", and even if it is, that's only -1 on a twos-complement machine, if we want to head off into some real pedantry...)

The need to use feof() and ferror() at least appear in the BUGS section on my Mac.  Linux is not so gracious.  The real bug, if you ask me, which no one did, is that getc() and pals return an int rather than a char, which is surprising and certainly has tripped me up several times across the decades (and yes, I understand that since any character value is a legal character to have gotten, you need some other way of signalling an error).
This is prolly why the authors steadfastly refused to commit to a particular value for EOF. Instead, they said in essence, that it was a matter of agreement, convention, if you will, and that whatever value was chosen, it should NEVER be a legal character. I made it -1, for v7, cuz it worked... and I wanted so badly to get a working ratfor program that I sacrificed any semblance of technical rigor to make it copy a character, onscreen, in real time, live. Heck, and it only took me a couple of days to figure out all how to get it working, EOF was easy, STDIN and STDOUT, not so much.


--------------P00oIwM2c1UeH0709OOBTC2c--