Skip to content

Commit

Permalink
interpreters/bas: Fix compiler warning after gcc upgrade to version 12
Browse files Browse the repository at this point in the history
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 <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 committed Dec 10, 2023
1 parent 1334306 commit f28797c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interpreters/bas/bas_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct Identifier
{
struct Symbol *sym;
enum ValueType defaultType;
char name[2/* ... */];
char name[0];
};

struct Next
Expand Down

0 comments on commit f28797c

Please sign in to comment.