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++/25541] New: invalid warning about unused variable


The -Wunused warning generation doesn't take modifications of global variables
into account.  Compiling the following code with -Wunused -Werror fails
although this is perfectly reasonable code.  Some registered exit handler could
check the value of the variable.

int global;

struct monitor
{
  ~monitor() { global = 1; }
};

int
main ()
{
  monitor m;
}


-- 
           Summary: invalid warning about unused variable
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drepper at redhat dot com


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


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