[Development] qt_message_fatal() in Linux

andrea mariofutire at googlemail.com
Tue Nov 21 22:52:00 CET 2017


On 21/11/17 21:42, Thiago Macieira wrote:
> On terça-feira, 21 de novembro de 2017 13:42:25 PST Thiago Macieira wrote:
>> On terça-feira, 21 de novembro de 2017 12:54:47 PST andrea via Development
>>
>> wrote:
>>> but in doing so I realised that in Linux the function
>>>
>>> static void qt_message_fatal(QtMsgType, const QMessageLogContext &context,
>>> const QString &message)
>>>
>>> in qlogging.cpp:1686 is just a call to
>>>
>>> std::abort().
>>>
>>> In VisualStudio in Debug it prints the error message.
>>>
>>> Since we are about to call abort, why not just print the message to stderr
>>> in all cases?
>>
>> What message?

static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message)

the last argument is a QString, the message.

for an example see here

qobject.cpp:214

     if (Q_UNLIKELY(version != QObjectPrivateVersion))
         qFatal("Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)",
                 version, QObjectPrivateVersion);

This eventually calls qt_message_fatal() with a message like the string above, but it is discarded.

Andrea




More information about the Development mailing list