3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-23 12:48:54 +00:00

Use (and ignore) the expression provided to log_assert in NDEBUG builds.

This avoids warnings in NDEBUG builds emitted when a variable is only
used in log_assert, but is always defined.
This commit is contained in:
whitequark 2020-06-17 19:30:53 +00:00
parent d5d0cc88d2
commit 2ffdb74fb1
3 changed files with 1 additions and 5 deletions

View file

@ -107,10 +107,8 @@ struct Macc
std::vector<RTLIL::State> config_bits = cell->getParam(ID::CONFIG).bits;
int config_cursor = 0;
#ifndef NDEBUG
int config_width = cell->getParam(ID::CONFIG_WIDTH).as_int();
log_assert(GetSize(config_bits) >= config_width);
#endif
int num_bits = 0;
if (config_bits[config_cursor++] == State::S1) num_bits |= 1;