From: Pavel Roskin <proski@gnu.org>
To: linux-sparse@vger.kernel.org
Subject: Finding all typedefs
Date: Fri, 27 Jul 2007 18:08:31 -0400 [thread overview]
Message-ID: <1185574111.2029.10.camel@dv> (raw)
Hello!
I'm trying to write a wrapper around GNU indent to make the output
result satisfy checkpatch.pl. Unfortunately, GNU indent is bad at
recognizing types if they are just bare words defined by typedef. Such
types should be supplied using the "-T" option to indent.
I would prefer to rely on sparse for finding all typedefs, since it's
better at parsing C code than any script I could write.
Is there any way to make sparse dump all type names declared with a
typedef? I don't see any of the programs in sparse sources do anything
like that. I think c2xml could be a good candidate, as it outputs the
symbol, but it doesn't give any indication that it's a typedef-defined
type:
$ make C=2 CHECK=/home/proski/src/sparse/c2xml |grep foo_t
<symbol type="node" id="_29" ident="foo_t"
file="/home/proski/src/at76/at76_usb.c" start-line="41" start-col="13"
end-line="41" end-col="18" bit-size="32" alignment="4" offset="0"
base-type-builtin="int"/>
Another nice thing would be to have a list of labels. Although they are
easier to find by scripts, I would prefer to find them in the same run.
--
Regards,
Pavel Roskin
next reply other threads:[~2007-07-27 22:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 22:08 Pavel Roskin [this message]
2007-07-27 23:01 ` Finding all typedefs Randy Dunlap
2007-08-01 15:45 ` Pavel Roskin
2007-08-01 17:01 ` Josh Triplett
2007-08-02 0:15 ` Rob Taylor
2007-08-02 7:31 ` Antwort: " Thomas Schmid
2007-08-03 0:49 ` Rob Taylor
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=1185574111.2029.10.camel@dv \
--to=proski@gnu.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).