Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2009 18:59:17 -0400
From:      James Bailie <jimmy@mammothcheese.ca>
To:        jimmy@mammothcheese.ca
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: fgetc doubts
Message-ID:  <49B6F0C5.8050706@mammothcheese.ca>
In-Reply-To: <49B6E91A.4040604@mammothcheese.ca>
References:  <49B6DC95.9070607@FreeBSD.org> <49B6E91A.4040604@mammothcheese.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jimmy@mammothcheese.ca>
http://www.mammothcheese.ca



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49B6F0C5.8050706>