From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3221 invoked by alias); 22 Sep 2004 16:33:36 -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 3213 invoked from network); 22 Sep 2004 16:33:35 -0000 Received: from unknown (HELO sadr.equallogic.com) (66.155.203.134) by sourceware.org with SMTP; 22 Sep 2004 16:33:35 -0000 Received: from sadr.equallogic.com (localhost.localdomain [127.0.0.1]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id i8MGXZFn015650 for ; Wed, 22 Sep 2004 12:33:35 -0400 Received: from M30.equallogic.com (m30 [172.16.1.30]) by sadr.equallogic.com (8.12.8/8.12.8) with SMTP id i8MGXZsw015645; Wed, 22 Sep 2004 12:33:35 -0400 Received: from pkoning.equallogic.com ([172.16.1.220]) by M30.equallogic.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 22 Sep 2004 12:33:35 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16721.43357.693576.988329@gargle.gargle.HOWL> Date: Wed, 22 Sep 2004 17:17:00 -0000 From: Paul Koning To: terra@gnome.org Cc: gcc@gcc.gnu.org, dk@artimi.com Subject: RE: signed vs unsigned pointer warning References: <20040922161751.B4F6A1422D53@darter.rentec.com> X-OriginalArrivalTime: 22 Sep 2004 16:33:35.0071 (UTC) FILETIME=[E7C3AEF0:01C4A0C1] X-SW-Source: 2004-09/txt/msg01290.txt.bz2 >>>>> "Morten" == Morten Welinder writes: Morten> Dave Korn writes: >> Until you try indexing an array with an 8-bit high ASCII char, of >> course. Then things become radically different. I've known buggy >> ctype implementations that have failed on this (ASCII > 127 being >> signed negative and the ctype function accidentally indexing >> memory space before an array full of ctype result flags). Morten> [/me gathers soapbox] Morten> I bet you have. In fact *ALL* ctype implementations will Morten> fail.[*] That includes glibc (moved) Morten> [*] Assuming (char)EOF==EOF, which it will be with signed Morten> characters and EOF==-1. EOF isn't a character. Morten> What glibc does is to *mostly* work around buggy programs Morten> that send (explicitly or implicitly) signed characters to, Morten> say, isprint. It does not always work, though, so glibc Morten> really did you a disservice. It is really hard to get people Morten> to fix their programs. I don't understand your point. isprint takes a char * argument. Its semantics don't depend on whether char is signed or unsigned. It's the job of the libc implementer to implement it correctly. It's perfectly trivial to do that. You can do it by casts, by configure, or by using a 384 entry array, to mention just a few. paul