I am using LibClang to list down all function calls and their corresponding definition. Following is the python script to do so:
def traverse(node):
if node.kind == CALL_EXPR:
print(node.displayname, node.get_defintion())
for c in node.get_children():
traverse(c)
Following is the cpp code I run this on:
#include<math.h>
int main()
{
float n = sqrt(3.0);
}
Now, for the CXcursor referring to sqrt, I get the output sqrt , None
Can somebody explain why is it not able to find the definition of the function?