Resolving function pointers with static analysis

By Mark Hermeling

Senior Director of Product Marketing

GrammaTech

February 27, 2018

Story

Resolving function pointers with static analysis

Function pointers in C are a useful construct, despite needing to look up the exact syntax when trying to program with them.

Function pointers in C are a useful construct, despite needing to look up the exact syntax when trying to program with them. They are potentially dangerous if misused since program execution can go to unwanted location. In fact, coding standards like MISRA C (e.g. rule 104) forbid the use of variable function pointers. If you are using function pointers, it can be tricky to figure out where they are pointing to. Luckily, a new function pointer resolver has been published to our customer community site for CodeSonar users.

The function pointer resolver makes use of our extension API to extend our existing set of rules. Once installed it can help identify which functions a pointer can point based on the abstract execution that CodeSonar performs during static analysis of the code. See the following screenshot.

 

Mark Hermeling, MSc has 15+ years of experience in software development tooling, operating systems, virtualization and networking technology in safe and secure, embedded and real-time systems. He has worked on projects building automotive, networking, aerospace and defense and industrial devices in North America, Europe and Asia. At GrammaTech, Mark is the Senior Director of Product Marketing, directing GrammaTech’s commercial software product and business development efforts. Prior to joining GrammaTech worked for Wind River Systems (an Intel Corporation subsidiary), Zeligsoft and IBM Rational. Mark holds a Master of Science degree in Computing Science from Eindhoven University of Technology for research into timing constraints overlaid on object-oriented languages. 

Software development professional with extensive international experience (Europe, North America, Asia) in assisting customers to get the most from the use of modern technologies and automation. Focused on understanding the customer and helping them to get product to market quicker. Able to abstract, think outside of the box, understand, educate, enable and solve. Worked in a variety of different roles in sales (including field engineering and field engineering management responsible for quota)

More from Mark