Finding all typedefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux