[cfe-dev] Newbie question on scan-build

Ted Kremenek kremenek at apple.com
Thu Mar 25 16:03:20 PDT 2010


Hi Luong,

Somehow I missed this email.  Won't the compiler catch these kind of changes with its regular type-checking warnings?  I'm not certain what you are asking for.  Did you want to build a tool that automatically fixed all callers of a function whose signature you are changing?

On Mar 19, 2010, at 11:05 AM, Luong Nguyen-Duy wrote:

> 
> Hi,
> 
> I am in need of some static code analyzer.  I need a tool which can 
> track variables def/use accross function
> boundary.
> 
> Following is a description of my problem:
> 
> I have a function A in which one of the incoming argument is declared as 
> (uint8_t *).   Function A will assign values to this incoming argument:
> 
> int A (uint_8 *i) {   *i = 255 };
> 
> now I need to change it to (uint32_t *)
> 
> Obviously I will need to track down all places which invoke function A, 
> and make changes to those
> local variables, and recursively if a function B calls function A and 
> pass into A B's incoming argument I will
> need to track down all invocation of B as well.  Example below:
> 
> 
> 
> int B () {
> 
> 
> unint_8  j;    // NEED TO CATCH THIS
> 
> A(&j);
> 
> k = *j;
> 
> }
> 
> 
> int C (unint_8 *k)
> 
> A(k);    // NEED TO CATCH THIS
> 
> }
> 
> 
> So the question is can I use scan-build to accomplish this?
> 
> 
> Thanks much,
> 
> 
> Luong
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list