[Development] Suggested addition to wiki.qt.io/Coding_Conventions

Thiago Macieira thiago.macieira at intel.com
Fri May 15 19:12:13 CEST 2015


On Friday 15 May 2015 07:59:19 Marc Mutz wrote:
> Interesting. I didn't know that. Please document it on
> https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++
> 
> I guess that means we should revert
> ab8366b5923ec0feb730df98040885669f7bbe38, too?

Whoa! Yes, we have to

void f(const QList<int>::iterator);
void f()
{
	f(QList<int>::iterator());
}

With the copy constructor:
        movq    %rsp, %rdi
        movq    $0, (%rsp)
        call    _Z1f8iterator

Without it:
        xorl    %edi, %edi
        call    _Z1f8iterator

> Then again, C++98 doesn't have the concept of trivial types. And QStringRef,
> after the proposed changes for Qt 6, still isn't a C++98 POD. Does that
> mean that C++11/C++98 builds become binary incompatible?

No. I think the definition of trivial types in C++11 came from the ABI, not the 
other way around. The text[1] today refers to trivial copy constructor and 
destructor, but it might have been updated after C++11. It used to say 
"implicit".

[1] https://mentorembedded.github.io/cxx-abi/abi.html#normal-call


-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list