Static analysis tool to detect ABI breaks in C++ [closed]
It's not very hard to break binary backwards-compatibility of a DSO/shared library with a C++ interface. That said, is there a static analysis tool, which can help detecting such ABI breaks, if it's given two different sets of header files: those of an earlier state of the DSO and those of the current state (and maybe DSOs as well)? Both free and commercial product suggestions are welcome.
If it could also warn about bad practices, e.g. inline functions and defaulted function parameters in DSO interfaces, it would be great.
abi-compliance-checker - a tool for checking backward binary/source-level compatibility of a shared C/C++ library (DSO):
A tool for checking backward binary and source-level compatibility of a C/C++ library. The tool checks header files and shared libraries of old and new versions and analyzes changes in API and ABI (ABI=API+compiler ABI) that may break binary and/or source compatibility: changes in calling stack, v-table changes, removed symbols, renamed fields, etc.
icheck - C interface ABI/API checker:
A tool for statically checking C interfaces for API and ABI changes. All changes to type declarations that can cause ABI changes should be detected, along with most API changes. icheck is intended for use with libraries, as a method of preventing ABI drift.
shlib-compat - ABI compatibility checker for shared libraries with symbol versioning:
shlib-compat uses dwarf debugging symbols to recreate and compare definitions of exported symbols, including function arguments and structural types.
Also you might be interested in the linux upstream tracker and linux abi tracker services. They are both powered by the abi-compliance-checker tool.
I assume that you are familiar with this tutorial: Binary Compatibility Issues with C++, if not read it!
I've heard about this tool: http://ispras.linuxbase.org/index.php/ABI_compliance_checker, however never tested or used one, so have no opinion.
Also this may interest you: Creating Library with backward compatible ABI that uses Boost
I remember at work they used GCC XML for testing binary compatibility. Basically what it does is generate an xml representation of the compiler object tree. The theory goes that if the xml is equivalent, they binary compatibility has been maintained.