Chapter 5 157
Creating and Using Libraries
Version Control with Shared Libraries
Specifying a Version Date
When adding modules to a library for a particular release of the library,
it is best to give all modules the same version date. For example, if you
complete file1.o on 04/93, file2.o on 05/93, and file3.o on 07/93, it
would be best to give all the modules the same version date, say 07/93.
The reason for doing this is best illustrated with an example. Suppose in
the previous example you gave each module a version date corresponding
to the date it was completed: 04/93 for file1.o, 05/93 for file2.o, and
07/93 for file3.o. You then build the final library on 07/93 and link an
application a.out with the library. Now suppose that you introduce an
incompatible change to function foo found in file1.o, set the version
date to 05/93, and rebuild the library. If you run a.out with the new
version of the library, a.out will get the new, incompatible version of
foo because its version date is still earlier than the date the application
was linked with the original library!