When trying to run https://github.com/Kray-G/kcs/blob/master/utility/myacc.c with kcs it generates garbage due to this declarations:
|
getgram() |
|
{ |
|
extern char *retcode; |
|
codeout() |
|
{ |
|
extern char *code0[], *code1[]; |
That are then defined later on in the same file:
|
char *retcode = "\t\t" SMYY "val = ps[1].val; return 0;"; |
|
|
|
char *code0[] = { |
If we move the definitions before it's use then I could get it to run:
kcs utility/myacc.c -v kcsrt/libsrc/kcs/json.y
uname -a
Linux XXXXX 5.4.0-137-generic #154~18.04.1-Ubuntu SMP Tue Jan 10 16:58:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Notice that the latest lacc can build an executable that runs as expected without need to reorder the variable definitions.
When trying to run https://github.com/Kray-G/kcs/blob/master/utility/myacc.c with
kcsit generates garbage due to this declarations:kcs/utility/myacc.c
Lines 1140 to 1142 in c2d116f
kcs/utility/myacc.c
Lines 1284 to 1286 in c2d116f
That are then defined later on in the same file:
kcs/utility/myacc.c
Lines 1394 to 1396 in c2d116f
If we move the definitions before it's use then I could get it to run:
Notice that the latest
lacccan build an executable that runs as expected without need to reorder the variable definitions.