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

Compiling with /Zc:forScope causes warnings when including <QtGui/QtGui>

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • Some future release
    • 4.4.1
    • Other
    • None

    Description

      Compiling with the qdebug.h include before the qbitarray.h include seems to turn off the /Zc:forScope in VS and outputs the warning:
      1>.\main.cpp(13) : warning C4288: nonstandard extension used : 'i' : loop control variable declared in the for-loop is used outside the for-loop scope; it conflicts with the declaration in the outer scope
      1> .\main.cpp(12) : definition of 'i' used
      1> .\main.cpp(7) : definition of 'i' ignored

      Swithcing the order of the includes will make the warning go away.

      #include "qdebug.h"
      #include "qbitarray.h"
      
      int main(int argc, char **argv)
      {
          for (int i = 0; i < 5; i++)
          {
          }
      
          char arr[2];
          int i = 0;
          arr[i] = 'a';
      }
      

      Seen on VS2005.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes