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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11850 invoked from network); 16 May 2020 21:56:28 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 16 May 2020 21:56:28 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7E44F9C99F; Sun, 17 May 2020 07:56:26 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 0D0B59C5E4; Sun, 17 May 2020 07:55:58 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; secure) header.d=mxes.net header.i=@mxes.net header.b="otwgLuV1"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id D58149C5E4; Sun, 17 May 2020 07:55:54 +1000 (AEST) Received: from smtp-out-3.mxes.net (smtp-out-3.mxes.net [198.205.123.68]) by minnie.tuhs.org (Postfix) with ESMTPS id D02899C5E1 for ; Sun, 17 May 2020 07:55:53 +1000 (AEST) Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 73BB5759FA; Sat, 16 May 2020 17:55:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1589666152; bh=d6VaCHrmP4nd/PqsMGtucmzBe2rZveNDT1HzYRJDj6Y=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date: Message-Id:References:To; b=otwgLuV1JjjF102vImjHrbGPzljb3yl6exxLtVVt0d5WNwKMjjRI229F/OqFIZmp5 H0jc2efTs78dVVOJDZPg5Q/2jrYGEDYdJjQX+A1s/Yc5SnHHUdeg6mtjipBzpyrSaw x93O0VtonodLn2hFjUvF0F/oYJjyL56TcgWStUhA= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) From: Ronald Natalie In-Reply-To: <20200516184516.EBFC22D2F140@macaroni.inf.ed.ac.uk> Date: Sat, 16 May 2020 17:55:50 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <252B4CA1-A67C-4C6E-8AE5-56ED6D4746A0@ronnatalie.com> References: <20200516184516.EBFC22D2F140@macaroni.inf.ed.ac.uk> To: Richard Tobin X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Sent-To: Subject: Re: [TUHS] v7 K&R C 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: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" It would have to be something bigger than char because you need EOF = (whatever it could be defined as) to be distinct from any character. =20 > On May 16, 2020, at 2:45 PM, Richard Tobin = wrote: >=20 >> The function prototype for getchar() is: int getchar(void); >>=20 >> It returns an int, not a char. In all likelihood this is = specifically >> *because* EOF is defined as -1. >=20 > It would have probably returned int anyway, because of the automatic > promotion of char to int in expressions. It was natural to declare > functions returning char as int, if you bothered to declare them at > all. As K&R1 said: >=20 > Since char promotes to int in expressions, there is no need > to declare functions that return char. >=20 > Similarly functions that might return short or float would normally > return int or double; there aren't separate atof and atod functions > for example. >=20 > -- Richard >=20 > --=20 > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. >=20