From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1929 invoked by alias); 11 Mar 2011 11:47:51 -0000 Received: (qmail 1921 invoked by uid 22791); 11 Mar 2011 11:47:51 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_SUB_GETRID X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Mar 2011 11:47:46 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1F4D82BB034; Fri, 11 Mar 2011 06:47:45 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LjYnmaDDUbcd; Fri, 11 Mar 2011 06:47:45 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 80BD62BAF9B; Fri, 11 Mar 2011 06:47:44 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id EC0941459AD; Fri, 11 Mar 2011 15:40:12 +0400 (RET) Date: Fri, 11 Mar 2011 14:21:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: 'Maxim Grigoriev' , gdb-patches@sourceware.org Subject: Re: [RFA] New rules for ARI (was [commit] Get rid of build warnings on xtensa-tdep.c) Message-ID: <20110311114012.GE30306@adacore.com> References: <4D798969.8070309@tensilica.com> <20110311064501.GA30306@adacore.com> <001e01cbdfd2$96205a60$c2610f20$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001e01cbdfd2$96205a60$c2610f20$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-03/txt/msg00659.txt.bz2 > so I tried to write a new rule > to find out if functions that have no parameters > do use () instead of (void). Thanks! > While at it, I also tried to figure out if > there were calls to functions in first lines > (or prototype declarations with the function name at first line). I think you meant first column? > OK to add these two new rules? I think they would be useful - but be sure to s/line/column/ in the code as well: > +# Only function implementation should be on first line > +BEGIN { doc["function call in first line"] = "\ > +Function name in first line should be restricted to function > implementation" > + category["function call in first line"] = ari_code > +} > +/^[a-z][a-z0-9_]*[[:space:]]*\((|[^*][^()]*)\)[[:space:]]*[^ \t]+/ { > + fail("function call in first line") > +} -- Joel