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 visual studio warnings
QtWS25 Last Chance

Disable visual studio warnings

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.3k 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.
  • S Offline
    S Offline
    santanaa
    wrote on 26 May 2013, 00:14 last edited by
    #1

    We treat warnings as bugs and our policy is that our own code has to build cleanly, so I need to be able to spot warnings about my code. When I build our qt based project in visual studio 2010 I get literally 10s of thousands of warnings about Qt's code. This is fine, I just need a way to disable them. Wrapping all of our include of qt headers with specific pragmas is not desirable. Any one know how to globably tun of warnings for just qt headers??

    sample:
    @
    299>c:\qt\4.8.4\include\qtcore../../src/corelib/tools/qlist.h(409): warning C4127: conditional expression is constant
    299>c:\qt\4.8.4\include\qtcore../../src/corelib/tools/qlist.h(430): warning C4127: conditional expression is constant
    299> c:\qt\4.8.4\include\qtcore../../src/corelib/tools/qlist.h(429) : while compiling class template member function 'void QList<T>::node_destruct(QList<T>::Node *,QList<T>::Node *)'
    299> with
    299> [
    299> T=QList<QVariant>
    299> ]
    299> c:\qt\4.8.4\include\qtcore../../src/corelib/tools/qlist.h(707) : while compiling class template member function 'void QList<T>::detach_helper(int)'
    299> with
    299> [
    299> T=QList<QVariant>
    299> ]
    299> c:\qt\4.8.4\include\qtcore../../src/corelib/tools/qlist.h(730) : while compiling class template member function 'QList<T>::~QList(void)'
    299> with
    299> [
    299> T=QList<QVariant>
    299> ]
    299> c:\qt\4.8.4\include\qtcore../../src/corelib/kernel/qmetatype.h(196) : see reference to function template instantiation 'void *qMetaTypeConstructHelper<T>(const T *)' being compiled
    299> with
    299> [
    299> T=QList<QList<QVariant>>
    299> ]
    299> c:\users\burlen\paraview\next\paraview\qt\core\pqSMAdaptor.h(47) : see reference to function template instantiation 'int qRegisterMetaType<QList<T>>(const char *,QList<T> *)' being compiled
    299> with
    299> [
    299> T=QList<QVariant>
    299> ]
    @

    [code wrappings added "see":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 , koahnig]

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 26 May 2013, 10:20 last edited by
      #2

      welcome to devnet

      you can use the a pragma for disabling and enabling warnings.
      @
      #ifdef _MSC_VER
      #pragma warning ( disable : 4127 )
      #endif
      @

      You can also use "enable" to switch on the warnings.

      The "problem" is to locate the headers and embracing them with these pragmas.

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

      1 Reply Last reply
      0

      1/2

      26 May 2013, 00:14

      • Login

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