From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6166 invoked by alias); 7 Apr 2007 06:18:26 -0000 Received: (qmail 6157 invoked by uid 22791); 7 Apr 2007 06:18:25 -0000 X-Spam-Check-By: sourceware.org Received: from ns.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 07 Apr 2007 07:18:22 +0100 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 3AFD2122ED; Sat, 7 Apr 2007 08:18:20 +0200 (CEST) From: Andreas Schwab To: Mark Kettenis Cc: sje@cup.hp.com, gdb-patches@sourceware.org Subject: Re: Patch for isdigit/isalpha/etc. macro arguments References: <200704062336.QAA17806@hpsje.cup.hp.com> <200704062348.l36NmiwC025816@brahms.sibelius.xs4all.nl> X-Yow: .. If I had heart failure right now, I couldn't be a more fortunate man!! Date: Sat, 07 Apr 2007 06:18:00 -0000 In-Reply-To: <200704062348.l36NmiwC025816@brahms.sibelius.xs4all.nl> (Mark Kettenis's message of "Sat, 7 Apr 2007 01:48:44 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00040.txt.bz2 Mark Kettenis writes: > Bleach! So that's not a viable option. I think it's time to find the > magic gcc option to turn the warning off. I mean > > char *s = "..."; > isalpha(*s); > > is perfectly reasonable code and should not result in compiler > warnings. This will crash and burn if *s < 0. You really need to cast to unsigned char if you want to get defined behaviour. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."