/images/bio-photo-small.jpg

Shallow and Pedantic

A person/tech/code blog of a coder/techie/person. Like calculus in a kiddie pool, the author of this blog is known to be quite shallow and pedantic.

Multiple library versions

Working with vendor code in C can get very tricky, especially when you except breaking changes to occur. Especially when you have multiple binaries depending on that vendor code, updating at different times, necessitating different live versions. Let’s explore.

Introduction

Assume you’re working with an external vendor, who is providing you with code for a wonderful function getFoo:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
// foo.h version 1.2.3

int getFoo();

// foo.c version 1.2.3

int getFoo() {
  sleep(1000); // TODO improve performance
  return 42
}

You use this function in many of your products - for example, in your best-selling barApp application: