Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Understand follow C/C++ function calls via pointers?

0
Posted

Does Understand follow C/C++ function calls via pointers?

0

Function pointers will befuddle pretty much any static analysis tool. With Understand, we associate dependence between the function and where its address is taken. This can work pretty well in some types of code, but not so well in others (for instance table/array driven setups where the taking of the address is well away from where it is actually used). So we do what we can automatically. And in the case where we can’t sort it out, we are looking into adding a persistent linkage via manual annotations of the code. As an alternative, you can modify your code to display function calls in Understand, but actually compile with function pointers. To do this use the __UNDC__ macro which is automatically defined in Understand, but not in the compiler> So in your top level include file add something like: CODE: //Enable tracking pointers with Understand_C #ifdef __UNDC__ #define func_pointer(x) x() #else #define func_pointer(x) #endif Then change your function pointer calls from: CODE: (*foo)

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123