From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15022 invoked by alias); 6 Apr 2007 23:51:26 -0000 Received: (qmail 15012 invoked by uid 22791); 6 Apr 2007 23:51:26 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 07 Apr 2007 00:51:22 +0100 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0) with ESMTP id l36NmiPg007418; Sat, 7 Apr 2007 01:48:44 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0/Submit) id l36NmiwC025816; Sat, 7 Apr 2007 01:48:44 +0200 (CEST) Date: Fri, 06 Apr 2007 23:51:00 -0000 Message-Id: <200704062348.l36NmiwC025816@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: sje@cup.hp.com CC: gdb-patches@sourceware.org In-reply-to: <200704062336.QAA17806@hpsje.cup.hp.com> (message from Steve Ellcey on Fri, 6 Apr 2007 16:36:06 -0700 (PDT)) Subject: Re: Patch for isdigit/isalpha/etc. macro arguments References: <200704062336.QAA17806@hpsje.cup.hp.com> 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/msg00038.txt.bz2 > Date: Fri, 6 Apr 2007 16:36:06 -0700 (PDT) > From: Steve Ellcey > > > Sorry, you obviously spent some serious amount of time fixing this, > > but I think this is just gross. It also would just hide the bug > > mentioned above. I guess we should use -liberty's "safe-ctype.h" > > instead. > > Hm, this seems to lead to some new problems. safe-ctype.h defines > ISALNUM, ISALPHA, ISDIGIT, etc. (uppercase) and if I start including > "safe-ctype.h" instead of , then I collide with > readline/chardefs.h in some files (like cli/cli-dump.c) because that > file includes readline/readline.h which includes readline/chardefs.h > which has its own definitions of ISALNUM, ISALPHA, ISDIGIT, etc. > > What to do? My best guess would be to have readline/chardefs.h not > define these macros if they are already defined. But now we are > reaching outside the gdb subdir. 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. And I really don't like adding the casts you propose. To me, a cast is an indication that something naughty is being done, and that certainly isn't the case here. Mark