Warning, ABI breakage from 2.074 to 2.075

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu May 25 07:36:43 PDT 2017


On Thursday, May 25, 2017 13:23:57 Joakim via Digitalmars-d wrote:
> On Thursday, 25 May 2017 at 10:42:44 UTC, Basile B. wrote:
> > Static libraries that are
> > - compiled with dmd 2.074 (maybe previous versions too)
> > - call format() in their API
> >
> > will be responsible for strange errors when used by programs
> > compiled with dmd 2.075. People will see their software raising
> > a FormatException (orphan argument) for no reason. When the
> > static library will be recompiled with dmd 2.075 the errors
> > will disappear.
> >
> > I haven't investigated much since there's been a non trivial
> > amount of change in std.format() during the this spring. I
> > don't know what to do with this facts except to report them
> > here.
>
> Why is this unexpected?  D has never committed to ABI stability
> across compiler versions or the different D compilers.

Yeah, if you're relying on ABI compatibility across releases, then you're
likely to have some weird problems. It may actually work often enough that
you can get away with it a good chunk of the time (I don't know), but we
certainly don't promised ABI compatibility, and we do break it some
percentage of the time. Heck, we frequently do stuff like templatize a
function that wasn't templatized before (generally to make it more generic),
which breaks all code that was taking it's address to use as a function
pointer (but doesn't break most uses of the function). We do try to avoid
superfluous breakage, and _most_ code should be fine from release to
release, but corner cases do get broken on a regular basis and that's even
when you recompile all your code, not even trying to use newly compiled code
with code compiled with an older compiler. The sitation is _far_ better than
it once was, but we're definitely not ABI stable, and the nature of D
actually makes it pretty hard to be.

- Jonathan M Davis



More information about the Digitalmars-d mailing list