From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>,
"'Pedro Alves'" <pedro@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: New ARI warning Sat Mar 12 01:53:29 UTC 2011
Date: Mon, 14 Mar 2011 12:52:00 -0000 [thread overview]
Message-ID: <000901cbe246$485773b0$d9065b10$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <E1Pz6z3-0006vZ-Cl@fencepost.gnu.org>
> -----Message d'origine-----
> De : Eli Zaretskii [mailto:eliz@gnu.org]
> Envoyé : lundi 14 mars 2011 13:35
> À : Pedro Alves
> Cc : gdb-patches@sourceware.org; pierre.muller@ics-cnrs.unistra.fr
> Objet : Re: New ARI warning Sat Mar 12 01:53:29 UTC 2011
>
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Mon, 14 Mar 2011 12:13:43 +0000
> > Cc: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> >
> > "A function declaration should not have its name in column zero. A
> > function definition should have its name in column zero."
>
> What can I say? it's ugly.
Eli, the only C coding standard I was ever confronted with
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.
>
> At the very least, please reformat the prototypes like this:
>
> extern whatever_type foo (type1_t,
> type2_t, const char **, foobar_t);
>
> not like Pierre originally suggested.
>
> 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
/^[a-z][a-z0-9_]*[[:space:]]*\((|[^*][^()]*)\)[[:space:]]*[^ \t]+/
awk pattern to avoid getting all function variables.
If someone can suggest a more complete pattern that would also
grab the above without matching
int (*test_var_function (int, int));
I would be grateful.
Pierre
next prev parent reply other threads:[~2011-03-14 12:49 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-12 2:17 GDB Administrator
2011-03-13 9:32 ` Pierre Muller
2011-03-13 10:24 ` [RFA] Fix ARI warning about function call in first column (was : New ARI warning Sat Mar 12 01:53:29 UTC 2011) Pierre Muller
2011-03-13 13:42 ` [RFA] Fix ARI warnings about function with no parameters ( " Pierre Muller
2011-03-14 16:03 ` Pierre Muller
2011-03-13 19:39 ` New ARI warning Sat Mar 12 01:53:29 UTC 2011 Eli Zaretskii
2011-03-14 11:26 ` Pierre Muller
2011-03-14 12:13 ` Eli Zaretskii
2011-03-14 12:34 ` Pedro Alves
2011-03-14 12:34 ` Eli Zaretskii
2011-03-14 12:49 ` Pierre Muller
2011-03-14 13:06 ` Eli Zaretskii
2011-03-14 12:51 ` Eli Zaretskii
2011-03-14 12:52 ` Pierre Muller [this message]
2011-03-14 13:16 ` Eli Zaretskii
2011-03-14 12:59 ` Pedro Alves
2011-03-14 13:27 ` Eli Zaretskii
2011-03-14 13:46 ` Pedro Alves
2011-03-14 15:46 ` Pierre Muller
2011-03-19 21:15 ` Mark Kettenis
[not found] ` <18667.385276831$1300008680@news.gmane.org>
2011-03-14 15:54 ` [RFA] Fix ARI warning about function call in first column Tom Tromey
2011-03-14 16:46 ` [RFA-v2] " Pierre Muller
2011-03-14 17:02 ` Tom Tromey
[not found] ` <001401cbe261$5490ec40$fdb2c4c0$%muller@ics-cnrs.unistra.fr>
2011-03-14 17:17 ` Eli Zaretskii
2011-03-14 17:26 ` Pierre Muller
[not found] ` <10281.0550401502$1300122152@news.gmane.org>
2011-03-14 17:39 ` Tom Tromey
2011-03-15 12:19 ` [RFA] Fix formatting in " Pierre Muller
[not found] ` <45563.9187516228$1300186224@news.gmane.org>
2011-03-15 15:42 ` Tom Tromey
2011-03-15 16:01 ` Pierre Muller
[not found] ` <002001cbe269$85ed0e60$91c72b20$%muller@ics-cnrs.unistra.fr>
2011-03-14 21:26 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000901cbe246$485773b0$d9065b10$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox