C++ API & ABI Versioning

By Mathieu Ropert

Software keeps changing, but not always as fast as its clients. A key to maintaining a library in the long run is to ensure a proper handling of the changes and their impacts. While it is sometimes necessary to break the API or the ABI, one must first know if and how his changes will translate to impacts on API or ABI.

In this talk I will define API and ABI in terms of impacts on compatibility, explain the difference between breaking and non-breaking changes and present a few techniques to handle them. We will quickly explain what APIs are, with an emphasis on the notion of contracts. Then the usually lesser known notion of ABI will be explained, going over the concepts of mangling, vtable layout and most importantly sizes, alignment and offsets in data structures. Finally we will discuss the two most important versioning strategies today, Semantic Versioning and Live at Head and how they can be used to handle changes to the API and the ABI over time and help clients adapt to them.