Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-26877

Fix some of the warnings that we currently disable in qglobal.h (MSVC)



    • Type: Suggestion
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 4.8.2, 5.0.0 Beta 1, 5.8.0
    • Fix Version/s: None
    • Component/s: Core: Other


      Currently qglobal.h disables some MSVC warnings if QT_NO_WARNINGS is defined:

      #if !defined(QT_CC_WARNINGS)
      #  define QT_NO_WARNINGS
      #if defined(QT_NO_WARNINGS)
      #  if defined(Q_CC_MSVC)
      #    pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
      #    pragma warning(disable: 4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
      #    pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
      #    pragma warning(disable: 4514) /* unreferenced inline/local function has been removed */

      Defining QT_CC_WARNINGS is no real option, because i get tons of warnings for Qt code, if QT_CC_WARNINGS is defined and i am then unable to find the relevant places in my own code.

      Is there a work-around for this?

      If not then the Qt source code should be fixed such that it is not necessary to disable those warnings, because disabling those warnings in a vital header file like qglobal.h (which is included in many many other header files of Qt) does effect the code of the library user, which is not acceptable in security and safety critical applications (like those that we do develop).


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            Unassigned Unassigned
            qtcomsupport Qt Support
            8 Vote for this issue
            17 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes