finding casts from a type

Brooks Davis brooks at one-eyed-alien.net
Mon Feb 7 08:10:09 PST 2005


I'm trying to figure out an efficent way to find all the places where a
given type (in my case struct ifnet *) is cast to another.  Does anyone
know of a tool to do this?  I need to include implicit casts to (void
*). I could do it by hand, but this is would be tedious and error prone
given that there are over 330 files that refrence struct ifnet in the
kernel.  The ideal solution would be a pragma or something to cause
gcc to generate a warning since once I move struct ifnet out of driver
softc's all casts will be bugs.  Initially I need to catch (void *)
casts, but that probably won't be necessicary long term.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050207/3b9df7a0/attachment.bin


More information about the freebsd-hackers mailing list