[Bug c++/44682] New: warning: variable ‘x’ set but not used

wouter dot vermaelen at scarlet dot be gcc-bugzilla@gcc.gnu.org
Sat Jun 26 13:29:00 GMT 2010


> cat bug.ii
struct Base1 {
    virtual ~Base1() {}
};
struct Base2 {
    virtual ~Base2() {}
};
struct Foo : Base1, Base2 {};

void f(Foo&);

void g(void* v) {
    Base2* base = static_cast<Base2*>(v);
    Foo* foo = static_cast<Foo*>(base);
    f(*foo);
}


> g++ -Wall -c bug.ii
bug.ii: In function ‘void g(void*)’:
bug.ii:12:9: warning: variable ‘base’ set but not used
[-Wunused-but-set-variable]


I'm using SVN revision trunk@161411 on linux x86_64.


-- 
           Summary: warning: variable ‘x’ set but not used
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wouter dot vermaelen at scarlet dot be


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



More information about the Gcc-bugs mailing list