semantic/parser: fix compile warning found by sparse

Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-05-30 12:51:09 +08:00
committed by Xiang Xiao
parent f875db41d4
commit fb9b41221d
35 changed files with 67 additions and 19 deletions
+4
View File
@@ -61,6 +61,10 @@ class SymbolTables(object):
self.emitline("#include <nuttx/compiler.h>")
self.emitline("#include <nuttx/symtab.h>\n")
self.emitline("extern int g_nallsyms;\n")
self.emitline(
"extern struct symtab_s g_allsyms[%d + 2];\n" % len(self.symbol_list)
)
self.emitline("%s int g_nallsyms = %d + 2;" % (noconst, len(self.symbol_list)))
self.emitline(
"%s struct symtab_s g_allsyms[%d + 2] =\n{"