SalamLang / Salam

Salam Language: The inaugural coding language for Persian and Arabic speakers, inspired by the word "salam" meaning "peace". With a user-friendly approach, it provides an accessible coding experience, promoting collaboration and simplicity for local developers and students.
https://www.salamlang.ir
GNU General Public License v3.0
2 stars 5 forks source link

Fix emcc errors #15

Closed BaseMax closed 3 months ago

BaseMax commented 3 months ago
max@DESKTOP-SSI3MPL:SalamLang$ emcc salam.c -o salam.js
salam.c:409:24: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        [TOKEN_TYPE_NUMBER] = {PRECEDENCE_LOWEST, nud_number, NULL},
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
salam.c:408:24: note: previous initialization is here
        [TOKEN_TYPE_NUMBER] = {PRECEDENCE_LOWEST, nud_number, NULL},
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
salam.c:659:28: warning: expression result unused [-Wunused-value]
                case TOKEN_TYPE_MULTIPY: "MULTIPY";
                                         ^~~~~~~~~
salam.c:1204:28: warning: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare]
                if ((*val)->string_value != "\0" && (*val)->string_value != NULL) {
                                         ^  ~~~~
salam.c:1362:10: warning: enumeration value 'AST_EXPRESSION_VALUE' not handled in switch [-Wswitch]
        switch ((*expr)->type) {
                ^
salam.c:1398:10: warning: enumeration values 'AST_STATEMENT_CONTINUE' and 'AST_STATEMENT_BREAK' not handled in switch [-Wswitch]
        switch ((*node)->type) {
                ^
salam.c:2197:5: error: expected expression
                                ast_node_t* function_node = parser_function(parser);
                                ^
salam.c:2198:30: error: use of undeclared identifier 'function_node'
                                if (parser->functions && function_node != NULL) {
                                                         ^
salam.c:2199:36: error: use of undeclared identifier 'function_node'
                                        array_push(parser->functions, function_node);
                                                                      ^
5 warnings and 3 errors generated.
emcc: error: '/usr/bin/clang-13 -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=5 -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D_LIBCPP_ABI_VERSION=2 -fno-threadsafe-statics -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/usr/share/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat salam.c -c -o /tmp/emscripten_temp_cr6mh82h/salam_0.o' failed (returned 1)
BaseMax commented 3 months ago

Fixed and done https://github.com/SalamLang/Salam/commit/996883dd71e3cca2143cc76fe3a925e4d434b492