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

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

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.2, 5.0.0 Beta 1, 5.8.0
    • Core: Other

    Description

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

      #if !defined(QT_CC_WARNINGS)
      #  define QT_NO_WARNINGS
      #endif
      #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).

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            qtcomsupport Qt Support
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            10 Vote for this issue
            Watchers:
            19 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes