Skip to content
Commit 4d8ffcca authored by Adrian Gielniewski's avatar Adrian Gielniewski Committed by Benjamin Cabé
Browse files

net: if: Add dummy member to anonymous union in net_if_addr



When both CONFIG_NET_IPV6_DAD and CONFIG_NET_IPV4_ACD are disabled, the
anonymous union in struct net_if_addr ends up with no members, which
results in a different struct layout between C and C++.

In C, an empty union has size 0, while in C++ it has size >=1, which
shifts the offsets of the following fields.

Add a 1-byte dummy member to the union to ensure consistent layout
across both compilers.

Signed-off-by: default avatarAdrian Gielniewski <adrian.gielniewski@nordicsemi.no>
parent d265dadf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment