From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13523 invoked by alias); 18 Dec 2002 20:47:39 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 13508 invoked from network); 18 Dec 2002 20:47:38 -0000 Received: from unknown (HELO neon-gw.transmeta.com) (63.209.4.196) by 209.249.29.67 with SMTP; 18 Dec 2002 20:47:38 -0000 Received: (from root@localhost) by neon-gw.transmeta.com (8.9.3/8.9.3) id MAA14804; Wed, 18 Dec 2002 12:47:23 -0800 Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) id xma014790; Wed, 18 Dec 02 12:47:00 -0800 Received: from casey.transmeta.com (casey.transmeta.com [10.10.25.22]) by deepthought.transmeta.com (8.11.6/8.11.6) with ESMTP id gBIKl3315572; Wed, 18 Dec 2002 12:47:03 -0800 (PST) Received: (from dje@localhost) by casey.transmeta.com (8.9.3/8.7.3) id MAA06454; Wed, 18 Dec 2002 12:47:03 -0800 From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15872.57031.583198.497704@casey.transmeta.com> Date: Wed, 18 Dec 2002 12:47:00 -0000 To: "Nick Kelsey" Cc: , cgen@sources.redhat.com Subject: patch - fix false keyword triggering in gas with cgen targets In-Reply-To: <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp> References: <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp> X-SW-Source: 2002-q4/txt/msg00110.txt.bz2 Nick Kelsey writes: > Hi all, > > Attached is patch to fix flase keyword triggering in gas with symbols such > as _foo. An equivalent solution is to move the '_' to desc.scm and either make it a default nonalpha_char or hardcode it as always being a nonalpha_char. However, I like changing cgen-asm.c better. '_' is typically a legit symbol char so better to bubble it up to the top and treat it like alnum's. I'm assuming of course this doesn't break existing ports. Given that the '_' was there for a long time I think it is a safe assumption, but still an assumption nonetheless. If down the road we ever have to revisit this decision we can move '_' to desc.scm and make it the default. --- Nit though. GNU coding standard say the || goes at the beginning of the next line. The way I remember this is that English reads as "if foo, or bar, or baz" not "if foo or, bar or, baz" *** cgen-asm.c 26 Nov 2002 18:12:48 -0000 --- cgen-asm.c 18 Dec 2002 02:16:00 -0000 *************** cgen_parse_keyword (cd, strp, keyword_ta *** 225,231 **** /* Allow letters, digits, and any special characters. */ while (((p - start) < (int) sizeof (buf)) && *p ! && (ISALNUM (*p) || strchr (keyword_table->nonalpha_chars, *p))) ++p; if (p - start >= (int) sizeof (buf)) --- 225,233 ---- /* Allow letters, digits, and any special characters. */ while (((p - start) < (int) sizeof (buf)) && *p ! && (ISALNUM (*p) || ! strchr (keyword_table->nonalpha_chars, *p) || ! *p == '_')) ++p; if (p - start >= (int) sizeof (buf))