[Development] Applications using -fno-rtti

Thiago Macieira thiago.macieira at intel.com
Sat Jun 20 22:45:04 CEST 2020


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.

No-exceptions is still allowed. No-RTTI is not.

> Anyway, were I to submit a patch replacing typeid() with something which
> does not require RTTI ("q->metaObject() == QProcess::staticMetaObject()"
> would work, I guess? Or maybe even comparing q->className()?), would
> that be accepted?

No, because it won't catch this:

class MyProcess : QProcess
{
protected:
    virtual void setupChildProcess();
};

Note the lack of Q_OBJECT.

But a variant of https://codereview.qt-project.org/c/qt/qtbase/+/292540 might 
be acceptable. It would replace the typeid() check with the GCC extension, 
which will work for all GCC-based builds, which is the totality of Linux 
distributions.

By the way, can you say what you needed to derive from QProcess for? If it was 
to override setupChildProcess() like in the example above, what are you doing 
in the function?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list