From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6324 invoked by alias); 8 Oct 2004 20:59:15 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 6316 invoked from network); 8 Oct 2004 20:59:14 -0000 Received: from unknown (HELO mail.shareable.org) (81.29.64.88) by sourceware.org with SMTP; 8 Oct 2004 20:59:14 -0000 Received: from mail.shareable.org (localhost [127.0.0.1]) by mail.shareable.org (8.12.8/8.12.8) with ESMTP id i98KxD81016064; Fri, 8 Oct 2004 21:59:13 +0100 Received: (from jamie@localhost) by mail.shareable.org (8.12.8/8.12.8/Submit) id i98KxCQ4016062; Fri, 8 Oct 2004 21:59:12 +0100 Date: Sat, 09 Oct 2004 07:05:00 -0000 From: Jamie Lokier To: Joe Buck , Nick Ing-Simmons , gcc@gcc.gnu.org, "'Morten Welinder'" , Dave Korn Subject: Re: signed vs unsigned pointer warning Message-ID: <20041008205912.GA16038@mail.shareable.org> References: <20040922161751.B4F6A1422D53@darter.rentec.com> <20040926192142.GA29842@mail.shareable.org> <20040926192142.GA29842@mail.shareable.org> <20041008130623.9516.4@llama.elixent.com> <20041008091714.A1695@synopsys.com> <20041008100853.A2207@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SW-Source: 2004-10/txt/msg00376.txt.bz2 Paul Jarc wrote: > > No, (unsigned)-1 does not turn into 255, it turns into a very large > > number. > > But character 255, as a signed char, is also -1, and so will also > become the same large number. The caller must cast char to unsigned > char to ensure that EOF is distinct. *Only* the caller can make the > distinction reliably, since only the caller knows whether this > particular -1 is supposed to be EOF. Is it necessary for them to be distinct? I didn't see any rule in "man isalpha" saying anything about EOF other than it's accepted as an argument value. In particular, is it ok if isalpha(EOF) == isalpha(255), whatever the value of isalpha(255)? Or is there a rule that is*(EOF) must return 0? -- Jamie