From f28797cddf26c6ac62d93ab9d80f6b48171a5511 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 9 Dec 2023 12:44:47 +0800 Subject: [PATCH] interpreters/bas: Fix compiler warning after gcc upgrade to version 12 bas_token.l: In function 'yylex': Error: bas_token.l:1210:31: error: 'strcpy' writing 1 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 1210 | } | ^ In file included from bas_auto.h:77, from bas_token.l:16: bas_token.h:103:8: note: at offset 2 into destination object 'name' of size 2 103 | char name[2/* ... */]; | ^~~~ Signed-off-by: Xiang Xiao --- interpreters/bas/bas_token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/bas/bas_token.h b/interpreters/bas/bas_token.h index bf4b03784..ffe3fc4cd 100644 --- a/interpreters/bas/bas_token.h +++ b/interpreters/bas/bas_token.h @@ -100,7 +100,7 @@ struct Identifier { struct Symbol *sym; enum ValueType defaultType; - char name[2/* ... */]; + char name[0]; }; struct Next