ThomasMertes/seed7

wiz.sd7 fails to compile

Closed this issue · 2 comments

Build log:

C:\seed7\prg>s7c.exe wiz.sd7
SEED7 COMPILER Version 3.1.527 Copyright (c) 1990-2021 Thomas Mertes
Source: wiz.sd7
Compiling the program ...
Generating code ...
after walk_const_list
1459 declarations processed
649 optimizations done
691 evaluations done
14 range checks inserted
372 index checks inserted
306 overflow checks inserted
Calling the C compiler ...
c:\seed7\bin\call_gcc -w -ffunction-sections -fdata-sections -c tmp_wiz.c 2>tmp_wiz.cerrs >NUL:
*** Errors in "/c/seed7/prg/tmp_wiz.c" - see "/c/seed7/prg/tmp_wiz.cerrs"

Error log:

no_file:90:34: error: initializer element is not constant
no_file:93:34: error: initializer element is not constant
no_file:96:34: error: initializer element is not constant
...
wiz.sd7: In function 'o_2660_ARoomAdjective':
wiz.sd7:618:16: error: lvalue required as unary '&' operand
       when { 1}: write_a("luxurious ");
                ^
wiz.sd7:619:16: error: lvalue required as unary '&' operand
       when { 2}: write_a("expensive ");
                ^
wiz.sd7:620:16: error: lvalue required as unary '&' operand
...

C output:

o_2618_write_a(&(&str[84] /* "luxurious " */));
...

I can reproduce this problem on my computer. I will look at it...

I refactored wiz.sd7. Now wiz.sd7 can be compiled. Additionally several improvements of wiz.sd7 have been done. E.g.: Previous user input can be obtained with the vertical cursor keys. Several corner cases now have the correct behavior. I close this issue. Please open a new issue, if there are other problems with wiz.sd7.