This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25541] New: invalid warning about unused variable
- From: "drepper at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2005 00:48:27 -0000
- Subject: [Bug c++/25541] New: invalid warning about unused variable
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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