This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] gdbadmin/ss/gdb_ari.sh update UCASE rule
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pierre Muller <muller at ics dot u-strasbg dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 15 Apr 2009 10:25:03 +0300
- Subject: Re: [RFA] gdbadmin/ss/gdb_ari.sh update UCASE rule
- References: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> 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.