This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50158] New: [4.7 Regression] invalid 'variable set but not used' warning (boolean used as index to an array)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50158

             Bug #: 50158
           Summary: [4.7 Regression] invalid 'variable set but not used'
                    warning (boolean used as index to an array)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 25080
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25080
reduced testcase

Compiler output:
$ gcc -Wunused-but-set-variable testcase.cpp -c
testcase.cpp: In function 'int foo(int)':
testcase.cpp:5:7: warning: variable 'array' set but not used
[-Wunused-but-set-variable]

The warning is give only when compiles as C++.

Tested revisions:
r177949 - fail
r173150 - OK
4.6.1 - OK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]