1

Hi so I'm able to match function calls using ASTMatchers. But I need to find the statement where one of the parameters of this function has been initialized. How do I do that?

int main(){
char* str = "abcde";
char dest[19];
size_t len = strlen(str);
strncpy(dest,str,len+1);
}

In the above example I found the call to strncpy and I need to find the initialization for len which should point to strlen.

Is there any way to do it using Clang? Thanks.

0 Answers0