You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/12/10 14:40:57 UTC

(nuttx-apps) branch master updated: interpreters/bas: Fix compiler warning after gcc upgrade to version 12

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new f28797cdd interpreters/bas: Fix compiler warning after gcc upgrade to version 12
f28797cdd is described below

commit f28797cddf26c6ac62d93ab9d80f6b48171a5511
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Dec 9 12:44:47 2023 +0800

    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 <xi...@xiaomi.com>
---
 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