nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiaoxi...@apache.org
Subject [incubator-nuttx-apps] 01/02: Fix bas_program.c build warning under macos
Date Fri, 17 Apr 2020 09:06:10 GMT
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/incubator-nuttx-apps.git

commit 5a29e86847562fbbb474696bc5f4148f8a516c67
Author: liuhaitao <liuhaitao@xiaomi.com>
AuthorDate: Fri Apr 17 10:03:10 2020 +0800

    Fix bas_program.c build warning under macos
    
    bas_program.c:234:35: error: adding 'size_t' (aka 'unsigned long') to a string does not
append to the string [-Werror,-Wstring-plus-int]
          FS_putChars(chn, "        " + len);
                           ~~~~~~~~~~~^~~~~
    bas_program.c:234:35: note: use array indexing to silence this warning
          FS_putChars(chn, "        " + len);
                                      ^
                           &          [    ]
    1 error generated.
    
    Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
---
 interpreters/bas/bas_program.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/interpreters/bas/bas_program.c b/interpreters/bas/bas_program.c
index dd6e0da..a4355ed 100644
--- a/interpreters/bas/bas_program.c
+++ b/interpreters/bas/bas_program.c
@@ -231,7 +231,7 @@ static void printName(const void *k, struct Program *p, int chn)
   FS_putChars(chn, (const char *)k);
   if (len < 8)
     {
-      FS_putChars(chn, "        " + len);
+      FS_putChars(chn, &("        "[len]));
     }
 }
 


Mime
View raw message