linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Finding all typedefs
@ 2007-07-27 22:08 Pavel Roskin
  2007-07-27 23:01 ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Roskin @ 2007-07-27 22:08 UTC (permalink / raw)
  To: linux-sparse

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-03  0:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-27 22:08 Finding all typedefs Pavel Roskin
2007-07-27 23:01 ` 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

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