From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3733 invoked by alias); 11 Dec 2008 23:31:38 -0000 Received: (qmail 3722 invoked by uid 22791); 11 Dec 2008 23:31:38 -0000 X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Dec 2008 23:30:58 +0000 Received: from Relay2.suse.de (relay-ext.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 BB46543F7B; Fri, 12 Dec 2008 00:30:55 +0100 (CET) From: Andreas Schwab To: Pedro Alves Cc: gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: RFA: fix macro expansion bug References: <200812112304.39302.pedro@codesourcery.com> X-Yow: How do you explain Wayne Newton's POWER over millions? It's th' MOUSTACHE... Have you ever noticed th' way it radiates SINCERITY, HONESTY & WARMTH? It's a MOUSTACHE you want to take HOME and introduce to NANCY SINATRA! Date: Thu, 11 Dec 2008 23:31:00 -0000 In-Reply-To: <200812112304.39302.pedro@codesourcery.com> (Pedro Alves's message of "Thu, 11 Dec 2008 23:04:38 +0000") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (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: 2008-12/txt/msg00215.txt.bz2 Pedro Alves writes: > Though, I'm having a bit of trouble convincing myself that the logic to > handle 'pp-number e|E|p|P|. sign' below is 100% sane. > > static int > get_pp_number (struct macro_buffer *tok, char *p, char *end) > { > ... > while (p < end) > { > if (macro_is_digit (*p) > || macro_is_identifier_nondigit (*p) > || *p == '.') > p++; > else if (p + 2 <= end > && strchr ("eEpP.", *p) > && (p[1] == '+' || p[1] == '-')) > p += 2; > else > break; > } > > It seems macro_is_identifier_nondigit will always eat any of "eEpP", > thus, say, when parsing "1e-" only "1e" will be identified as a pp > number, leaving "+" in the stream. Is this right? Also, a sign can only follow [eEpP], but not [.]. 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."