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

"#ifdef Status" inconsistencies

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P3: Somewhat important
    • 5.0.0
    • 4.1.0
    • Other
    • None

    Description

      The following snippet is from qdatastream.h:
      ...
      #ifdef Status
      #error qdatastream.h must be included before any header file that defines Status
      #endif
      ...

      The following snippet is from qsettings.h:
      ...
      #ifdef Status // ### we seem to pick up a macro Status --> int somewhere
      #undef Status
      #endif
      ...

      They should probably be handled in the same way.

      Answer from Trolltech:

      Since X11 headers are not namespace safe, they have to be included after Qt headers. Generally, headers should always be included in the order from the most specialized to the most general one to prevent namespace pollution:

      #include "myownheader.h"
      #include <someQtHeader.h>
      #include <X11/someXheader>
      #include <string.h> // system header

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes