Improve ASSERT
Macro to Handle Operator Precedence More Intuitively
#29
Labels
ASSERT
Macro to Handle Operator Precedence More Intuitively
#29
Description
The current implementation of the
ASSERT
macro requires extra parentheses to handle operator precedence correctly, such as:Without these parentheses, expressions may lead to incorrect logic due to operator precedence rules.
For example, a developer might mistakenly write:
This could be misinterpreted by the compiler as:
Instead of the intended:
Proposed Solution:
svut/svut/svut_h.sv
Line 159 in d2b4d62
Use a pair of parentheses to wrap
exp
such as:Benefits:
Thanks for your work on this framework, it definitely helps me a lot.
Best Regards
The text was updated successfully, but these errors were encountered: