From: "Christopher Li" <sparse@chrisli.org>
To: Josh Triplett <josh@freedesktop.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: sparse ctags
Date: Wed, 8 Aug 2007 02:30:30 -0700 [thread overview]
Message-ID: <70318cbf0708080230j5278e787j8684aa7ae0aa400b@mail.gmail.com> (raw)
In-Reply-To: <46B7E932.2060804@freedesktop.org>
On 8/6/07, Josh Triplett <josh@freedesktop.org> wrote:
>
> Looks like some enums grew new values and ctags didn't stay up to date. I
> think this patch fixes that particular problem:
>
> diff --git a/ctags.c b/ctags.c
> index f5b8fc7..63f59a5 100644
> --- a/ctags.c
> +++ b/ctags.c
> @@ -111,6 +111,8 @@ static void examine_symbol(struct symbol *sym)
> return;
> if (sym->ident && sym->ident->reserved)
> return;
> + if (sym->type == SYM_KEYWORD)
> + return;
>
> add_tag(sym);
> base = sym->ctype.base_type;
> @@ -158,6 +160,8 @@ static void examine_namespace(struct symbol *sym)
> return;
>
> switch(sym->namespace) {
> + case NS_KEYWORD:
> + return;
> case NS_LABEL:
> sym->kind = 'l';
> break;
>
That looks good to me.
> After some further investigation, I think ctags really shouldn't look at
> SYM_PREPROCESSOR or NS_PREPROCESSOR either. I came up with the attached
> patch, which I will apply soon unless someone shouts. Chris?
I think SYM_PREPROCESSOR is also used by macros with NS_MACRO.
You just need to strip out the NS_PREPROCESSOR. I guess you try to
skip the symbol with NS_SYMBOL: and SYM_PREPROCESSOR at the same
time.
I am not sure about the test for "sym->type == SYM_KEYWORD",
do you see some case trigger that?
Sorry, I just find out that I get drop out from the sparse mail list
for a while and miss
a lot of interesting discussions. Blame my mail server.
>
> This still doesn't fix running ctags on multiple files; ctags seems to get
> confused in much the same way sparse does when run on multiple files: it spews
> a pile of redefinition errors.
Should make sparse able to clean up itself. I will see what I can do.
Chris
prev parent reply other threads:[~2007-08-08 9:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-26 8:45 sparse ctags Aneesh Kumar
2007-08-06 19:03 ` Josh Triplett
2007-08-07 3:38 ` Josh Triplett
2007-08-08 9:30 ` Christopher Li [this message]
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=70318cbf0708080230j5278e787j8684aa7ae0aa400b@mail.gmail.com \
--to=sparse@chrisli.org \
--cc=josh@freedesktop.org \
--cc=linux-sparse@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).