From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30565 invoked by alias); 15 Apr 2009 07:25:13 -0000 Received: (qmail 30535 invoked by uid 22791); 15 Apr 2009 07:25:05 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_50,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout2.012.net.il (HELO mtaout2.012.net.il) (84.95.2.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Apr 2009 07:24:59 +0000 Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KI400D00SI2DN00@i_mtaout2.012.net.il> for gdb-patches@sourceware.org; Wed, 15 Apr 2009 10:24:56 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.229.34.97]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KI400KC7SLJPO20@i_mtaout2.012.net.il>; Wed, 15 Apr 2009 10:24:56 +0300 (IDT) Date: Wed, 15 Apr 2009 07:25:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] gdbadmin/ss/gdb_ari.sh update UCASE rule In-reply-to: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr> To: Pierre Muller Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83bpqyml9s.fsf@gnu.org> References: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr> 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: 2009-04/txt/msg00295.txt.bz2 > From: "Pierre Muller" > Date: Tue, 14 Apr 2009 23:49:33 +0200 > > The current UCASE rule > triggers lost of false warnings > as for instance > > gdb/breakpoint.c:8522: code: UCASE function: Function name is uppercase. > > gdb/breakpoint.c:8520: /* Create a vector of all tracepoints. */ > gdb/breakpoint.c:8521: > gdb/breakpoint.c:8522: VEC(breakpoint_p) * > gdb/breakpoint.c:8523: all_tracepoints () > gdb/breakpoint.c:8524: { > > I propose a rule that only looks for: > a function name starting with a capital letter at the start > of the line, followed by a open brace, optionally parameters, a closing > brace and nothing else (apart from spaces) Wouldn't it be better to apply this test only on lines immediately preceding a line that begins with a left brace? I believe we already have a rule whereby each function needs to begin as follows: TYPE NAME (PARAMETERS) { So we want to have the second line, and only that line, be subject to the "UCASE function" test, right? The false positive that you are trying to resolve trips on the first line, which is not what we want. OTOH, the replacement you suggest: > -/^[A-Z][[:alnum:]_]*[[:space:]]*\(/ { > +/^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ { seems to catch cases such NAME (PARAMETERS) without any context, so it could easily trip on unrelated source lines, because it does not guarantee that this is a function definition.