[Development] Applications using -fno-rtti

Elvis Stansvik elvstone at gmail.com
Sun Jun 21 15:37:00 CEST 2020


Den sön 21 juni 2020 kl 14:37 skrev Konstantin Ritt <ritt.ks at gmail.com>:
>
> > I think we then had discussions when moving from Qt 4 to Qt 5, that we will start requiring RTTI.
>
> However this was never promoted, and now you're saying people who ported their projects with no-rtti to Qt5 had to enable rtti years ago or expect crashes?)
>
> Thanks to Alberto for pointing this issue now, when the majority didn't switch to the new LTS yet.
> I, for example, didn't know the issue with dynamic_cast across dll boundaries is not an issue anymore.
>
> Plz make sure the documentation is up to date and `CONFIG += rtti_off` does nothing as of 5.15.

Don't touch CONFIG += rtti_off, since QMake can be used for non-Qt
projects, who may want the ability to toggle this.

Agree the docs should be updated, and it should have been more clearly
communicated.

The -no-rtti configure switch for Qt itself was removed with
https://codereview.qt-project.org/c/qt/qtbase/+/182660 (since Qt 5.8).

Elvis

>
> Regards,
> Konstantin
>
>
> вс, 21 июн. 2020 г. в 14:23, Lars Knoll <lars.knoll at qt.io>:
>>
>>
>>
>> > On 21 Jun 2020, at 13:10, Giuseppe D'Angelo via Development <development at qt-project.org> wrote:
>> >
>> > Il 20/06/20 22:45, Thiago Macieira ha scritto:
>> >> On Saturday, 20 June 2020 11:31:25 PDT Alberto Mardegan wrote:
>> >>> I think I missed an announcement about Qt applications having to use
>> >>> RTTI; on the opposite, I thought that the whole point of QMetaObject was
>> >>> not to require RTTI support; has this changed?
>> >> As you can see from the commit, no provision was made for no-RTTI builds. I
>> >> don't think they've ben allowed since 5.0.
>> >
>> > The Qt coding policy document still says that no RTTI facilities are allowed within Qt:
>> >
>> >> https://wiki.qt.io/Coding_Conventions
>> >
>> > (Unchanged since 2015; before, I'm sure that document was somewhere else, with the same contents regarding this matter.)
>> >
>> > Where/when was such a change of policy decided?
>>
>> We didn’t want it in earlier versions of Qt for mainly two reasons. Early implementations had quite an overhead on library size, and dynamic_cast didn’t work reliable between DLL boundaries on Windows. Both problems have gone away many years ago.
>>
>> I have to go by what I remember now, but I think we then had discussions when moving from Qt 4 to Qt 5, that we will start requiring RTTI. The reasons where that dynamic_cast<> and typeid require it and it has very little overhead on library size (as opposed to exceptions which are still optional). By that time (or maybe even earlier), we also started compiling Qt with RTTI enabled on all platforms.
>>
>> But it looks like nobody ever adjusted the wiki page :/
>>
>> We are making use of dynamic_cast and typeid in Qt nowadays, so I guess it’s high time we adjust the wiki.
>>
>> Cheers,
>> Lars
>>
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> https://lists.qt-project.org/listinfo/development
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development


More information about the Development mailing list