1x -Werror=unused-variable happens :-)

U.Mutlu um@mutluit.com
Sat Jun 23 12:10:00 GMT 2018


Hi,
when building the languages=c,c++ with "-g0 -DNDEBUG", then the following 
error happens:

../../../gcc_trunk/libitm/method-serial.cc: In member function 'void 
GTM::gtm_thread::serialirr_mode()':
../../../gcc_trunk/libitm/method-serial.cc:309:12: error: unused variable 'ok' 
[-Werror=unused-variable]
        bool ok = disp->trycommit (priv_time);
             ^~

Of course one can get rid of it by giving also -Wno-error=unused-variable.


But nevertheless, someone more knowledgeable should check & possibly fix that 
assert related error:

       bool ok = disp->trycommit (priv_time);
       // Given that we're already serial, the trycommit better work.
       assert (ok);

I think maybe so:

       // Given that we're already serial, the trycommit better work.
#ifndef NDEBUG
       const bool ok = disp->trycommit (priv_time);
       assert (ok);
#else
       disp->trycommit (priv_time);
#endif


Btw, this is svn trunk with the default supporting libs.


-- 
U.Mutlu



More information about the Gcc mailing list