This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] New rules for ARI (was [commit] Get rid of build warnings on xtensa-tdep.c)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: 'Maxim Grigoriev' <maxim at tensilica dot com>, gdb-patches at sourceware dot org
- Date: Fri, 11 Mar 2011 15:40:12 +0400
- Subject: Re: [RFA] New rules for ARI (was [commit] Get rid of build warnings on xtensa-tdep.c)
- References: <4D798969.8070309@tensilica.com> <20110311064501.GA30306@adacore.com> <001e01cbdfd2$96205a60$c2610f20$@muller@ics-cnrs.unistra.fr>
> 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