parameters of macros in lib/eal/include/rte_test.h are not parenthesized
http://bugs.dpdk.org/show_bug.cgi?id=1925
Bug ID: 1925
Summary: parameters of macros in lib/eal/include/rte_test.h are
not parenthesized
Product: DPDK
Version: 26.03
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: [email protected]
Reporter: [email protected]Target Milestone: ---
Parameters of macros like RTE_TEST_ASSERT_EQUAL defined in lib/eal/include/rte_test.h are not enclosed in parentheses, which potentially may result in unintended operator precedence after substitution and in the worst case scenario false negatives in library and user tests. E.g. the following statement:
```c RTE_TEST_ASSERT_EQUAL(port_status & FLAG_UP, FLAG_UP, "Port is not UP!"); ```
will check bit 1 (FLAG_UP == FLAG_UP) of port_status, not FLAG_UP.
See https://gcc.gnu.org/onlinedocs/cpp/Operator-Precedence-Problems.html
Same problem in app/test/test.h
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
http://bugs.dpdk.org/show_bug.cgi?id=1925
Thomas Monjalon ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|IN_PROGRESS |RESOLVED--- Comment #4 from Thomas Monjalon ([email protected]) --- Resolved in https://dpdk.org/id/55ab726133
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.