Timur Kelin Posted January 7, 2020 Report Posted January 7, 2020 include/sysc/communication/sc_fifo.h:269:10: warning: unused variable ‘write_success’ [-Wunused-variable] bool write_success = sc_fifo<T>::nb_write(val_); include/sysc/communication/sc_fifo.h:226:10: warning: unused variable ‘read_success’ [-Wunused-variable] bool read_success = sc_fifo<T>::nb_read(val_); sc_fifo.h: bool write_success = sc_fifo<T>::nb_write(val_); sc_assert( write_success ); sc_report.h #if defined(NDEBUG) && !defined(SC_ENABLE_ASSERTIONS) // disable assertions #define sc_assert(expr) \ ((void) 0) .... i.e. expr is not addressed when assertions are disabled This is resolved with #if defined(NDEBUG) && !defined(SC_ENABLE_ASSERTIONS) // disable assertions #define sc_assert(expr) \ ((void)(expr)) .... Quote
Paul Floyd Posted January 11, 2020 Report Posted January 11, 2020 sc_assert does the same as the C std lib assert. You probably don't want to paste `expr` in the macro in case it has side effects (not that you should be doing that). Quote
Timur Kelin Posted January 14, 2020 Author Report Posted January 14, 2020 True. It means that the updates should be made to sc_fifo.h: template <class T> inline void sc_fifo<T>::read( T& val_ ) { while( num_available() == 0 ) { sc_core::wait( m_data_written_event ); } bool read_success = sc_fifo<T>::nb_read(val_); if( !read_success ) { sc_assert( read_success ); } } Quote
maehne Posted January 28, 2020 Report Posted January 28, 2020 Thanks @Timur Kelin for reporting this issue! I have forwarded it to the SystemC LWG to investigate how to fix it best in the proof-of-concept implementation of SystemC. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.