From ea04ee077316244df07a5fc3ba45e431cd195ac1 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 9 Dec 2025 19:50:14 +0100 Subject: [PATCH] sys/include/net/zep.h: add NONSTRING attribute This fixes the following compilation error when using modern GCC: RIOT/cpu/native/socket_zep/socket_zep.c: In function '_send_zep_hello': RIOT/cpu/native/socket_zep/socket_zep.c:244:29: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (3 chars into 2 available) [-Werror=unterminated-string-initialization] 244 | .hdr.preamble = "EX", | ^~~~ cc1: all warnings being treated as errors --- sys/include/net/zep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/include/net/zep.h b/sys/include/net/zep.h index 4cb427dfc9..8c7bad1db2 100644 --- a/sys/include/net/zep.h +++ b/sys/include/net/zep.h @@ -24,6 +24,7 @@ #include #include "byteorder.h" +#include "compiler_hints.h" #include "net/ntp_packet.h" #ifdef __cplusplus @@ -51,6 +52,7 @@ extern "C" { * @brief ZEP header definition */ typedef struct __attribute__((packed)) { + NONSTRING char preamble[2]; /**< Preamble code (must be "EX") */ uint8_t version; /**< Protocol Version (must be 1 or 2) */ } zep_hdr_t;