* [DPDK/core Bug 1925] parameters of macros in lib/eal/include/rte_test.h are not parenthesized
@ 2026-04-03 8:55 bugzilla
0 siblings, 0 replies; only message in thread
From: bugzilla @ 2026-04-03 8:55 UTC (permalink / raw)
To: dev
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: dev@dpdk.org
Reporter: marat.khalili@huawei.com
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
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-03 8:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 8:55 [DPDK/core Bug 1925] parameters of macros in lib/eal/include/rte_test.h are not parenthesized bugzilla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox