From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25614 invoked by alias); 14 Mar 2011 12:49:54 -0000 Received: (qmail 25606 invoked by uid 22791); 14 Mar 2011 12:49:53 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 12:49:47 +0000 Received: from md2.u-strasbg.fr (md2.u-strasbg.fr [IPv6:2001:660:2402::187]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p2ECnbYK013489 ; Mon, 14 Mar 2011 13:49:38 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms4.u-strasbg.fr [130.79.204.13]) by md2.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2ECnbGm042582 ; Mon, 14 Mar 2011 13:49:37 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2ECnaV7070605 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Mon, 14 Mar 2011 13:49:37 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" , "'Pedro Alves'" Cc: References: <20110312015329.GA20179@sourceware.org> <006701cbe220$a1a8dba0$e4fa92e0$@muller@ics-cnrs.unistra.fr> <201103141213.43979.pedro@codesourcery.com> In-Reply-To: Subject: RE: New ARI warning Sat Mar 12 01:53:29 UTC 2011 Date: Mon, 14 Mar 2011 12:52:00 -0000 Message-ID: <000901cbe246$485773b0$d9065b10$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00717.txt.bz2 > -----Message d'origine----- > De=A0: Eli Zaretskii [mailto:eliz@gnu.org] > Envoy=E9=A0: lundi 14 mars 2011 13:35 > =C0=A0: Pedro Alves > Cc=A0: gdb-patches@sourceware.org; pierre.muller@ics-cnrs.unistra.fr > Objet=A0: Re: New ARI warning Sat Mar 12 01:53:29 UTC 2011 >=20 > > From: Pedro Alves > > Date: Mon, 14 Mar 2011 12:13:43 +0000 > > Cc: "Pierre Muller" > > > > "A function declaration should not have its name in column zero. A > > function definition should have its name in column zero." >=20 > What can I say? it's ugly. Eli, the only C coding standard I was ever confronted with=20 is GDB coding standards. And this is probably one of the first rules that I understood. I find this rule quite useful, as it allows easy tracking of function implementation. >=20 > At the very least, please reformat the prototypes like this: >=20 > extern whatever_type foo (type1_t, > type2_t, const char **, foobar_t); >=20 > not like Pierre originally suggested. >=20 > That is, let the left paren and at least one argument be on the same > line as the function name. I agree with the principle, but it is not always possible: What should we do with this: $ grep -n -C 3 "^[a-z][a-z0-9_]*[[:space:]]*(.*)" *.h linux-nat.h-147-/* Create a generic GNU/Linux target using traditional linux-nat.h-148- ptrace register access. */ linux-nat.h-149-struct target_ops * linux-nat.h:150:linux_trad_target (CORE_ADDR (*register_u_offset)(struct gdbarch *, int, int)); linux-nat.h-151- linux-nat.h-152-/* Register the customized GNU/Linux target. This should be used linux-nat.h-153- instead of calling add_target directly. */ OK, I must admit that I cheated, because that did not even appear in the ARI list, while it should. It should be in the list because it is one of the functions declarations that are in first column, it does not appear because I oversimplified the rule using=20 /^[a-z][a-z0-9_]*[[:space:]]*\((|[^*][^()]*)\)[[:space:]]*[^ \t]+/=20 awk pattern to avoid getting all function variables. If someone can suggest a more complete pattern that would also grab the above without matching=20 int (*test_var_function (int, int)); I would be grateful. Pierre