From 21c30f80af80007ea7448eeeed1366042bf1ec8c Mon Sep 17 00:00:00 2001 From: wangming9 Date: Wed, 30 Aug 2023 20:33:05 +0800 Subject: [PATCH] net/local: fix build error on CONFIG_DEBUG_OPTLEVEL="-O3" Summary The following compilation error occurs after configuring CONFIG_DEBUG_OPTLEVEL="-O3" CC: local/local_fifo.c In file included from local/local_fifo.c:25: In function 'local_format_name', inlined from 'local_cs_name' at local/local_fifo.c:101:3, inlined from 'local_create_fifos' at local/local_fifo.c:431:3: local/local_fifo.c:84:16: error: '%x' directive output may be truncated writing between 1 and 8 bytes into a region of size between 5 and 112 [-Werror=format-truncation=] 84 | CONFIG_NET_LOCAL_VFS_PATH "/%s%s%" PRIx32, | ^~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: wangming9 --- net/local/local_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c index 363f22b0bc..c5c30f65f9 100644 --- a/net/local/local_fifo.c +++ b/net/local/local_fifo.c @@ -50,7 +50,7 @@ #define LOCAL_SUFFIX_LEN 2 #define LOCAL_FULLPATH_LEN (sizeof(CONFIG_NET_LOCAL_VFS_PATH) + \ - UNIX_PATH_MAX + LOCAL_SUFFIX_LEN + 2) + UNIX_PATH_MAX + LOCAL_SUFFIX_LEN + 2 + 8) /**************************************************************************** * Private Functions