Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active January 29, 2019 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/824a1d3c380bb9845b8bdf673920df59 to your computer and use it in GitHub Desktop.
Save ancorgs/824a1d3c380bb9845b8bdf673920df59 to your computer and use it in GitHub Desktop.

Leaving aside what is correct and what is not, I have problems putting these two sentences from the chat together (from a purelly technical low-level POV).

  1. We can do any change in the WhateverImpl classes without affecting ABI compatibility "because users of library does not use Impl".

  2. A change in the public Bcache breaks ABI compatibility "for all programs linked to libstorage-ng, no matter if bcache stuff is used at all".

Why changing the Bcache class has an binary influence in the other public classes but changing WhateverImpl does not? How are they different in that regard? As I understand, the fact that WhateverImpl is non-public is a convention, not something the compiler knows.

@ancorgs
Copy link
Author

ancorgs commented Jan 28, 2019

(2) is oversimplifying things a lot.

It is safe to extend the Bcache class.

It is not safe to modify its behavior, the semantics of any parameters to its methods (including the constructors!), or to remove any method.

Sure. In both cases (1 and 2) I meant doing intrusive changes like changing parameters or removing methods.

@aschnell
Copy link

My statement is a bit out of context: Changing the major library version (a consequence of the ABI break) breaks linking for all programs (unless both the old and the new library are provided (and thus also both maintained)).

@ancorgs
Copy link
Author

ancorgs commented Jan 29, 2019

Ok. Got it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment