From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5656 invoked by alias); 8 Oct 2004 17:31:57 -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 5637 invoked from network); 8 Oct 2004 17:31:55 -0000 Received: from unknown (HELO ram.rentec.com) (192.5.35.66) by sourceware.org with SMTP; 8 Oct 2004 17:31:55 -0000 Received: from darter.rentec.com (darter.rentec.com [172.26.132.158]) by ram.rentec.com (8.12.9/8.12.1) with ESMTP id i98HVthP004852; Fri, 8 Oct 2004 13:31:55 -0400 (EDT) Received: by darter.rentec.com (Postfix, from userid 414) id E89761422D56; Fri, 8 Oct 2004 13:31:53 -0400 (EDT) To: Joe.Buck@synopsys.com From: terra@gnome.org (Morten Welinder) Cc: gcc@gcc.gnu.org In-reply-to: <20041008091714.A1695@synopsys.com> (message from Joe Buck on Fri, 8 Oct 2004 09:17:14 -0700) Subject: Re: signed vs unsigned pointer warning 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> Message-Id: <20041008173153.E89761422D56@darter.rentec.com> Date: Fri, 08 Oct 2004 18:57:00 -0000 X-SW-Source: 2004-10/txt/msg00366.txt.bz2 Why can't an implementation define isxxx(c) to return something like table_lookup[(unsigned)(c)] ? Because isxxx needs to work with EOF, typically -1. And regardless of the implementation's value of EOF, you cannot cast to "unsigned char" either because that would make EOF collide with one of the other 256 valid inputs. So to summarize: someone screwed up with the definition of isxxx and it is not fixable by the implementation. Therefore, get used to seeing code like const char *foo = whatever; if (isspace ((unsigned char)*foo)) oink (); no matter how ugly it is. Morten