[Qt-interest] binaries in Ubuntu versions

Harald Fernengel harald at trolltech.com
Mon Dec 1 16:26:00 CET 2008


Hi,

On Monday 01 December 2008 16:17:04 Oliver.Knoll at comit.ch wrote:
> Harald Fernengel wrote on Monday, December 01, 2008 1:25 PM:
> >> ...
> >> Generally? I remember one "glitch" where the Trolls accidentally made
> >> a default argument (something like "int foo = 0") non-default. That
> >> broke the binary compatibility in the early 4.x days between two Qt
> >> versions (or was it even in the late 3.3.x days? Can't remember).
> >
> > Default arguments are not part of the ABI.
> >
> > If you know about any ABI changes in the Qt 4 series, please let us
> > know.
>
> I obviously seem to remeber the same "binary incompatibility" as Arnold has
> in mind, see his post:
>
> "Apart from one minor release in the Qt4 cycle, Qt is binary compatible."
>
> And AFAIK it had to to with an argument in some Qt method had a default
> value, as in:
>
>   QFoo::theMethod(int bar = 42);
>
> which was accidentally removed in the next minor release, as in:
>
>   QFoo::theMethod(int bar);
>
> Now older Qt applications which relied on the default value of '42' now
> would provide "random memory garbage" for the argument 'bar' at best, which
> clearly breaks binary compatibility. So I don't quite understand what you
> meant with "Default arguments are not part of the ABI", because they
> clearly are.

the default value is substituted by the compiler at compile time, not by the 
linker at runtime. No "random memory garbage" is possible.

A good reference of what is binary compatible and what not can be found here:

	http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++

Removing default arguments can be source code incompatible, though, but any Qt 
application linked to an older version of Qt will run with the newer version.

Best regards,
Harald



More information about the Qt-interest-old mailing list