xiaoxiang781216 commented on code in PR #1590: URL: https://github.com/apache/nuttx-apps/pull/1590#discussion_r1116191942
########## interpreters/bas/bas_value.c: ########## @@ -2026,18 +2042,29 @@ struct String *Value_toWrite(struct Value *this, struct String *s) struct Value *Value_nullValue(enum ValueType type) { - static struct Value integer = { V_INTEGER }; - static struct Value real = { V_REAL }; - static struct Value string = { V_STRING }; - static char n[] = ""; + static struct Value integer = + { + V_INTEGER + }; + + static struct Value real = + { + V_REAL + }; + + static struct Value string = + { + V_STRING + }; + static int init = 0; Review Comment: > Also I do not see where `init` is set to 1. Is that needed at all? Can we go with static initialization for all the structures? No, struct Value contain union, it's hard to initialize union with c89 syntax. So, I add code to set init to 1 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org