sasagawa888 / eisl

ISLisp interpreter/compiler
Other
275 stars 23 forks source link

[regression in 3.22] link.c:79:26: error: function definition is not allowed here #292

Closed yurivict closed 1 year ago

yurivict commented 1 year ago

Compilation fails:

link.c:79:26: error: function definition is not allowed here
    int arg_pop1(int th) {
                         ^
link.c:83:30: error: function definition is not allowed here
    int shelter_pop1(int th) {
                             ^
link.c:92:25: error: use of undeclared identifier 'arg_pop1'; did you mean 'arg_pop'?
    init_f0(ARGPOP_IDX, arg_pop1);
                        ^~~~~~~~
                        arg_pop
./eisl.h:689:5: note: 'arg_pop' declared here
int arg_pop(int th);
    ^
link.c:93:29: error: use of undeclared identifier 'shelter_pop1'; did you mean 'shelter_pop'?
    init_f0(SHELTERPOP_IDX, shelter_pop1);
                            ^~~~~~~~~~~~
                            shelter_pop
./eisl.h:1335:5: note: 'shelter_pop' declared here
int shelter_pop(int th);
    ^

Functions aren't allowed to be defined inside of other functions in C.

clang-15

sasagawa888 commented 1 year ago

Fixed. Thank you.