[Issue 24181] dmd compiled tinylisp.c runtime error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 18 22:18:32 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24181

--- Comment #6 from mw <mingwu at gmail.com> ---
In the same github repo, there is a equivalent commented .c file (dmd generated
binary has the same runtime error):

https://github.com/Robert-van-Engelen/tinylisp

https://github.com/Robert-van-Engelen/tinylisp/blob/main/src/tinylisp-commented.c

and the design doc:

https://github.com/Robert-van-Engelen/tinylisp/blob/main/tinylisp.pdf



gcc works fine:

$ make tinylisp-commented
cc     tinylisp-commented.c   -o tinylisp-commented
(env) zhou at joort:~/project/unzip/tinylisp/src$ ./tinylisp-commented
tinylisp
930>(+ 3 5)
8


$ dmd tinylisp-commented.c 
tinylisp-commented.c: Error: module `tinylisp-commented` has non-identifier
characters in filename, use module declaration instead

$ ln -s tinylisp-commented.c tinylisp_commented.c

$ dmd tinylisp_commented.c

$ ./tinylisp_commented 
tinylisp
930>(+ 3 5)
ERR


# -m32 works confirmed:
$ dmd -m32 tinylisp_commented.c
$ ./tinylisp_commented
tinylisp
930>(+ 3 5)
8

--


More information about the Digitalmars-d-bugs mailing list