From cc7b7d991b59b29a7a46b0b6adba7933a2c59cc5 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Mon, 3 May 2021 22:51:11 -0700 Subject: [PATCH] [routing-manager] add message to static_assert (#6560) static_assert with no message is a C++17 extension. --- src/core/border_router/routing_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 128854418..1e8765a91 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -658,7 +658,7 @@ void RoutingManager::SendRouterAdvertisement(const Ip6::Prefix *aNewOmrPrefixes, uint8_t buffer[kMaxRouterAdvMessageLength]; uint16_t bufferLength = 0; - static_assert(sizeof(mRouterAdvMessage) <= sizeof(buffer)); + static_assert(sizeof(mRouterAdvMessage) <= sizeof(buffer), "RA buffer too small"); memcpy(buffer, &mRouterAdvMessage, sizeof(mRouterAdvMessage)); bufferLength += sizeof(mRouterAdvMessage);