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. Disable MSVC compiler warnings
QtWS25 Last Chance

Disable MSVC compiler warnings

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 4.5k Views
  • 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.
  • A Offline
    A Offline
    Andy314
    wrote on 10 Jan 2016, 15:34 last edited by
    #1

    I use QtCreator with MSVC 2013 and cannot eliminate this damned compiler warnings. I tested:

    QMAKE_CXXFLAGS += -wd4189
    QMAKE_CXXFLAGS_WARN_OFF += -wd4189
    QMAKE_CFLAGS_WARN_OFF += -wd4189
    QMAKE_CXXFLAGS_DEBUG+= -wd4189
    QMAKE_CFLAGS_RELEASE += -wd4189
    QMAKE_CFLAGS_DEBUG+= -wd4189
    QMAKE_CFLAGS_RELEASE += -wd4189

    Nothing helps ! Here is the line generated from qmake:

    cl -c -nologo -Zc:wchar_t -FS -wd4189 -Zi -MDd -wd4189 -GR -W3 -w34100 -w34189 -w44996 -EHsc

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 10 Jan 2016, 16:03 last edited by
      #2

      Hi,
      you've probably already seen this posting on stackoverflow ( http://stackoverflow.com/questions/20402722/why-disable-specific-warning-not-working-in-visual-studio ) but perhaps it helps. So maybe you want to try QMAKE_CXXFLAGS_WARN_ON -= -wd4189. I think it would be a bit weird if it worked but who knows ^_^

      A 1 Reply Last reply 10 Jan 2016, 16:15
      1
      • ? A Former User
        10 Jan 2016, 16:03

        Hi,
        you've probably already seen this posting on stackoverflow ( http://stackoverflow.com/questions/20402722/why-disable-specific-warning-not-working-in-visual-studio ) but perhaps it helps. So maybe you want to try QMAKE_CXXFLAGS_WARN_ON -= -wd4189. I think it would be a bit weird if it worked but who knows ^_^

        A Offline
        A Offline
        Andy314
        wrote on 10 Jan 2016, 16:15 last edited by
        #3

        Hi @Wieland ,
        Wow :-) this is the solution.
        I think the problem was the order of the switches in the command line created from QMake. It puts the QMAKE_CXXFLAGS_WARN_ON at the end of it, so you can overwrite the previous warning settings.

        Thank you very much.

        1 Reply Last reply
        1

        2/3

        10 Jan 2016, 16:03

        • Login

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