Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pierre Muller <muller@ics.u-strasbg.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] gdbadmin/ss/gdb_ari.sh update UCASE rule
Date: Wed, 15 Apr 2009 07:25:00 -0000	[thread overview]
Message-ID: <83bpqyml9s.fsf@gnu.org> (raw)
In-Reply-To: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr>

> 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.


  reply	other threads:[~2009-04-15  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 21:49 Pierre Muller
2009-04-15  7:25 ` Eli Zaretskii [this message]
2009-04-20 16:01   ` [PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules Pierre Muller
2009-04-20 17:15     ` Andreas Schwab

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=83bpqyml9s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    /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