From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 10 22:59:18 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB5C7106564A for ; Tue, 10 Mar 2009 22:59:18 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: from smtp102.rog.mail.re2.yahoo.com (smtp102.rog.mail.re2.yahoo.com [206.190.36.80]) by mx1.freebsd.org (Postfix) with SMTP id 6368A8FC15 for ; Tue, 10 Mar 2009 22:59:18 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: (qmail 58990 invoked from network); 10 Mar 2009 22:59:17 -0000 Received: from unknown (HELO ?72.138.160.206?) (jimmy@72.138.160.206 with plain) by smtp102.rog.mail.re2.yahoo.com with SMTP; 10 Mar 2009 22:59:17 -0000 X-YMail-OSG: ALtQFRkVM1ntaqc3G9ZtJ1BTyxmpvekSUVLn.00R1gLTWDav.xPyH05o3dy5NbCZqQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <49B6F0C5.8050706@mammothcheese.ca> Date: Tue, 10 Mar 2009 18:59:17 -0400 From: James Bailie User-Agent: Thunderbird 2.0.0.19 (X11/20090116) MIME-Version: 1.0 To: jimmy@mammothcheese.ca References: <49B6DC95.9070607@FreeBSD.org> <49B6E91A.4040604@mammothcheese.ca> In-Reply-To: <49B6E91A.4040604@mammothcheese.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: fgetc doubts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jimmy@mammothcheese.ca List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2009 22:59:19 -0000 I must correct myself. It's more likely the return value of fgetc(), after having been assigned to a char, is being sign-extended when that char is compared to the in EOF, so that the comparison becomes a comparison between 0xffffffff and 0xffffffff. James Bailie wrote: > ...EOF is getting cast to a char implicitly in the comparison, so the > comparison becomes a comparison between 0xff and 0xff. -- James Bailie http://www.mammothcheese.ca