mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +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:
parent
d5d0cc88d2
commit
2ffdb74fb1
3 changed files with 1 additions and 5 deletions
|
@ -236,7 +236,7 @@ static inline void log_assert_worker(bool cond, const char *expr, const char *fi
|
|||
}
|
||||
# define log_assert(_assert_expr_) YOSYS_NAMESPACE_PREFIX log_assert_worker(_assert_expr_, #_assert_expr_, __FILE__, __LINE__)
|
||||
#else
|
||||
# define log_assert(_assert_expr_)
|
||||
# define log_assert(_assert_expr_) do { if (0) { (void)(_assert_expr_); } } while(0)
|
||||
#endif
|
||||
|
||||
#define log_abort() YOSYS_NAMESPACE_PREFIX log_error("Abort in %s:%d.\n", __FILE__, __LINE__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue