zephyr/subsys/net/l2
Jukka Rissanen ab9b85b199 net: Build assert issue with llvm
Remove the build assert from NET_L3_REGISTER() macro as that
is causing an issue with llvm. Add runtime check of the handler
pointer value.

subsys/net/l2/ethernet/arp.c:1044:1: error: static_assert expression
is not an integral constant expression

ETH_NET_L3_REGISTER(ARP, NET_ETH_PTYPE_ARP, arp_recv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
        NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/net_core.h:190:2: note: expanded from
macro 'NET_L3_REGISTER'
        BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/toolchain/gcc.h:87:51: note: expanded from
macro 'BUILD_ASSERT'
define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
                                                  ^~~~~~
subsys/net/l2/ethernet/arp.c:1044:1: note: cast from 'void *' is not
allowed in a constant expression
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
        NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
        ^
include/zephyr/net/net_core.h:190:29: note: expanded from
macro 'NET_L3_REGISTER'
        BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
                                   ^
/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded
from macro 'NULL'
  define NULL ((void*)0)

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-01-21 19:29:55 +01:00
..
canbus
dummy
ethernet net: Build assert issue with llvm 2025-01-21 19:29:55 +01:00
ieee802154 net: l2: ieee802154: shell: Fix stringop-truncation 2024-10-09 13:50:00 +02:00
offloaded_netdev
openthread net: openthread: Allow a platform to select a Settings backend. 2024-12-02 18:18:20 +01:00
ppp net: l2: ppp: ensure proper null-termination in ppp_fsm_close 2024-08-14 09:40:23 +02:00
virtual net: ethernet/vlan: Add support for embedding ll header 2024-12-19 10:21:28 +01:00
wifi net: wifi: shell: fix 11k neighbor request cannot specify ssid 2025-01-10 09:49:55 +01:00
CMakeLists.txt
Kconfig