Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMAKE_CXXFLAGS_WARN_OFF - still getting warnings

QMAKE_CXXFLAGS_WARN_OFF - still getting warnings

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 1.6k 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
    Anonymous_Banned275
    wrote on last edited by
    #1

    After adding QMAKE_CXXFLAGS_WARN_OFF in all of mine .pro files I am still getting GCC warnings of unused variables.

    What did I do wrong ?

    QMAKE_CXXFLAGS += -v
    QMAKE_CXXFLAGS_WARN_OFF

    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      After adding QMAKE_CXXFLAGS_WARN_OFF in all of mine .pro files I am still getting GCC warnings of unused variables.

      What did I do wrong ?

      QMAKE_CXXFLAGS += -v
      QMAKE_CXXFLAGS_WARN_OFF

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @AnneRanch said in QMAKE_CXXFLAGS_WARN_OFF - still getting warnings:

      QMAKE_CXXFLAGS_WARN_OFF

      Although I have not tried any of this, I am not sure that is correct in itself. I think you are supposed to set that to a value, such as QMAKE_CXXFLAGS_WARN_OFF -= -Wno-unused-parameter or QMAKE_CXXFLAGS_WARN_OFF -= -Wall.

      Having said that, I think you should read through, say, https://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project, or https://stackoverflow.com/questions/22129383/removing-unused-parameters-warning-in-qtcreator and others

      1 Reply Last reply
      0
      • kkoehneK Offline
        kkoehneK Offline
        kkoehne
        Moderators
        wrote on last edited by
        #3

        Use CONFIG += warn_off in your .pro file to disable warnings. This will make sure the compiler is called with all the flags set in QMAKE_CXXFLAGS_WARN_OFF (which should be automatically set by the default mkspecs, so usually no reason to change it).

        Director R&D, The Qt Company

        JonBJ 1 Reply Last reply
        1
        • kkoehneK kkoehne

          Use CONFIG += warn_off in your .pro file to disable warnings. This will make sure the compiler is called with all the flags set in QMAKE_CXXFLAGS_WARN_OFF (which should be automatically set by the default mkspecs, so usually no reason to change it).

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @kkoehne said in QMAKE_CXXFLAGS_WARN_OFF - still getting warnings:

          Use CONFIG += warn_off in your .pro file

          Which is what the answers in the mentioned https://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project suggest.

          1 Reply Last reply
          1
          • A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #5

            In an essence - simple GCC -w option to remove ALL warnings is turned into convoluted set of guessing instructions.
            For example " remove most warning" is just introducing another level of guessing how "most" is determined.
            I am not sure why it is so difficult for coders to post instruction such as
            QMAKE_CXXFLAGS_WARN_OFF whic to non -English native clearly reads
            "turn it off " and no additional instruction should be necessary.
            So in KISS principle - I used an option which by itself does nothing, hence committed no crime.

            Case closed.
            Let's keep coding....

            1 Reply Last reply
            0

            • Login

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