Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Warning C4715 with usage of MSVC 2019 Compiler
Forum Updated to NodeBB v4.3 + New Features

Warning C4715 with usage of MSVC 2019 Compiler

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 284 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Markus_Metrohm
    wrote on 8 Mar 2022, 08:29 last edited by
    #1

    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

    1 Reply Last reply
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 8 Mar 2022, 09:20 last edited by
      #2

      What Qt version?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Markus_Metrohm
        wrote on 8 Mar 2022, 10:06 last edited by Markus_Metrohm 3 Aug 2022, 10:07
        #3

        I'm working with 5.15.8. Sorry for this missing info.

        1 Reply Last reply
        0
        • C Online
          C Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 8 Mar 2022, 10:18 last edited by
          #4

          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.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0

          1/4

          8 Mar 2022, 08:29

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved