Warning C4715 with usage of MSVC 2019 Compiler
-
wrote on 8 Mar 2022, 08:29 last edited by
Hello all,
By compiling my Windows Desktop Application with the MSVC 2019 Compiler (16.9.32126.311 amd64) I get the warning C4715. A look into the Qt Code in file qlogging.h shows the following lines:
#ifndef Q_CC_MSVC Q_NORETURN #endif Q_DECL_COLD_FUNCTION void fatal(const char *msg, ...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
In my Setup, the Q_CC_MSVC define is set. This makes sense, but I don't understand why Q_NORETURN is not used in this case. After changing the lines to
Q_NORETURN Q_DECL_COLD_FUNCTION void fatal(const char *msg, ...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
the warning disappears. In the Microsoft Docs you find the confirmation that the MSVC Compiler knows the attribute __declspec(noreturn).
Could someone tell me, why this check is done this way? Have I to change my configuration? Is there a further define that has to be set?
Thanks for supporting me.
Regards Markus
-
What Qt version?
-
wrote on 8 Mar 2022, 10:06 last edited by Markus_Metrohm 3 Aug 2022, 10:07
I'm working with 5.15.8. Sorry for this missing info.
-
You should take what Q_NORETURN is defined to in your case and also ask the commercial Qt support - 5.15.8 is not publicity available so no real help from our side possible.
1/4