Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2005 17:25:46 +0100
From:      Joerg Sonnenberger <joerg@britannica.bec.de>
To:        hackers@freebsd.org
Subject:   Re: finding casts from a type
Message-ID:  <20050207162546.GA41246@britannica.bec.de>
In-Reply-To: <20050207161012.GA23177@odin.ac.hmc.edu>
References:  <20050207161012.GA23177@odin.ac.hmc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 07, 2005 at 08:10:13AM -0800, Brooks Davis wrote:
> 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.

What about using preprocessor / sed magic to convert struct ifnet to
volatile struct ifnet? The few places where this is correctly casted
away should be easy to find.

Joerg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050207162546.GA41246>