> Without an explicit type, all parameters of this macro are considered as > a signed integer. > > ../app/test/test_fib.c:270:20: runtime error: left shift of > 128 by 24 places cannot be represented in type 'int' > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior > ../app/test/test_fib.c:270:20 in > > Signed-off-by: David Marchand <david.march...@redhat.com> > --- > lib/net/rte_ip4.h | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/lib/net/rte_ip4.h b/lib/net/rte_ip4.h > index d4b38c513c..822a660cfb 100644 > --- a/lib/net/rte_ip4.h > +++ b/lib/net/rte_ip4.h > @@ -65,10 +65,8 @@ struct __rte_aligned(2) __rte_packed_begin rte_ipv4_hdr { > } __rte_packed_end; > > /** Create IPv4 address */ > -#define RTE_IPV4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \ > - (((b) & 0xff) << 16) | \ > - (((c) & 0xff) << 8) | \ > - ((d) & 0xff)) > +#define RTE_IPV4(a, b, c, d) (((uint32_t)((a) & 0xff) << 24) | > ((uint32_t)((b) & 0xff) << 16) | \ > + ((uint32_t)((c) & 0xff) << 8) | ((uint32_t)((d) & 0xff))) > > /** Maximal IPv4 packet length (including a header) */ > #define RTE_IPV4_MAX_PKT_LEN 65535 > -- Acked-by: Konstantin Ananyev <konstantin.anan...@huawei.com> > 2.50.0
- [PATCH v4 09/22] stack: fix unaligned accesses on ... David Marchand
- [PATCH v4 10/22] build: support Undefined Behavior... David Marchand
- [PATCH v4 11/22] test/telemetry: catch errors in s... David Marchand
- [PATCH v4 12/22] ipc: fix mp message alignment for... David Marchand
- [PATCH v4 13/22] graph: fix stats query with no no... David Marchand
- [PATCH v4 14/22] graph: fix unaligned access in st... David Marchand
- [PATCH v4 15/22] eventdev: fix listing timer adapt... David Marchand
- [PATCH v4 16/22] test/power: fix tests without pow... David Marchand
- [PATCH v4 17/22] test/raw: fix test without skelet... David Marchand
- [PATCH v4 18/22] net: fix IPv4 macro with highest ... David Marchand
- RE: [PATCH v4 18/22] net: fix IPv4 macro with ... Konstantin Ananyev
- [PATCH v4 19/22] rib6: fix some highest bits handl... David Marchand
- [PATCH v4 20/22] cfgfile: fix section count with n... David Marchand
- [PATCH v4 22/22] ci: extend coverage with UBSan David Marchand
- [PATCH v4 21/22] test/func_reentrancy: fix EAL ini... David Marchand
- [PATCH v5 00/22] Run with UBSan in GHA David Marchand
- [PATCH v5 01/22] ci: save ccache on failure David Marchand
- [PATCH v5 02/22] test/telemetry: fix test calling ... David Marchand
- [PATCH v5 03/22] test/mempool: fix test without st... David Marchand
- [PATCH v5 04/22] eal: fix plugin dir walk David Marchand
- [PATCH v5 06/22] cmdline: fix highest bit port lis... David Marchand