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. disabling compiler warnings in Creator editor?
Forum Updated to NodeBB v4.3 + New Features

disabling compiler warnings in Creator editor?

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 6 Posters 22.6k Views 4 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.
  • SGaistS SGaist

    Hi,

    Not in the editor (it's unrelated to it), but you can disable that in your .pro file by setting the appropriate compiler flag.

    mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #3

    @SGaist so...no way to suppress the warning in the editor?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      AFAIK, if you eliminate it at compile time, it should not appear in the list either.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #5

        Hmm...did I not properly form this line in my .pro file?

        QMAKE_CXXFLAGS += "-Wno-old-style-cast"
        
        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #6

          Hi
          Just to be sure You did not mean these ?
          alt text

          1 Reply Last reply
          0
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #7

            No...this:
            0_1533074546596_compilerwarning.PNG

            mrjjM 1 Reply Last reply
            0
            • mzimmersM mzimmers

              No...this:
              0_1533074546596_compilerwarning.PNG

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @mzimmers
              Ok it looks clangcode model but not 100% sure
              Try Help->Plugins
              alt text

              Disable it and restart Creator and see.

              1 Reply Last reply
              6
              • mzimmersM Offline
                mzimmersM Offline
                mzimmers
                wrote on last edited by
                #9

                Mrjj: that was it. Thanks very much...I'd never really had reason to look at code model options before, so I never would have found that.

                jsulmJ 1 Reply Last reply
                0
                • mzimmersM mzimmers

                  Mrjj: that was it. Thanks very much...I'd never really had reason to look at code model options before, so I never would have found that.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  @mzimmers If it is your own code you should rather fix these warnings instead of ignoring them.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  4
                  • aha_1980A Offline
                    aha_1980A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on last edited by aha_1980
                    #11

                    Hi @mzimmers,

                    As already said, better is fixing that issues - but sometimes you cannot do it for legacy projects.

                    Solution in that case is not to disable the Clang plugin, but to configure it:

                    Tools > Options > C++ > Code Model > Clang Code Model > Manage

                    There you can create your own config and apply either global or for a single project.

                    Regards

                    PS: The config switch you are looking for should be -Wno-old-style-cast

                    Qt has to stay free or it will die.

                    1 Reply Last reply
                    5
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #12

                      Thanks, aha. In this case, the warnings come header files supplied by a third party and intended for use with C (which I don't believe has the modern casts yet, and in any event, needs to be retroactively compatible with older compilers), so fixing them is out.

                      Thanks for the lesson on managing the code model...another part of Creator I'd never used, so that was a good thing to get exposed to.

                      K 1 Reply Last reply
                      1
                      • mzimmersM mzimmers

                        Thanks, aha. In this case, the warnings come header files supplied by a third party and intended for use with C (which I don't believe has the modern casts yet, and in any event, needs to be retroactively compatible with older compilers), so fixing them is out.

                        Thanks for the lesson on managing the code model...another part of Creator I'd never used, so that was a good thing to get exposed to.

                        K Offline
                        K Offline
                        koahnig
                        wrote on last edited by
                        #13

                        @mzimmers

                        You may also tune the clang code model and ignore single warnings to be displayed in the editor.

                        You may want to check out last of post here

                        Possibly you can switch off the macros before and on after the include. I would expect that the clang code model will be able to pick it up. As said by many before, it is not a good idea to ignore warnings. As a matter of fact I start to love the warnings shown directly in the code editor. Even though it is a bit confusing the first time ;)

                        Vote the answer(s) that helped you to solve your issue(s)

                        1 Reply Last reply
                        1

                        • Login

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