Re: Werror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have used the test variable as:
int statistics()
{
    test = &(stud);
    assert(test->total != 0);
    return true;
} 


then get error: variable ‘test’ set but not used
[-Werror=unused-but-set-variable] 

if i changed the code to:

int statistics()
{
    test = &(stud);
    if(test->total !=0)
   {
   }
    assert(test->total != 0);
    return true;
} 


it will compile successfully



--
View this message in context: http://gcc.1065356.n5.nabble.com/Werror-tp1235149p1235193.html
Sent from the gcc - Help mailing list archive at Nabble.com.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux