Closed MichaelScofield closed 4 years ago
Nevermind, change to call _printf
works.
Thanks Michael. I'd be pretty sure the macOS compiler and environment is different enough from Ubuntu/Debian Linux that some changes to the code generator will be required.
Firstly, thank you for sharing this great compiler writing jounery, I'm rather interested!
I'm in chapter 4 (generating assembly code), and trying to follow the code.
Here's the out assembly codes (saved in file "
out.s
"):When running it with
cc -o out out.s
, it complained with
How is the error happened and how to fix it?
Thanks in advance!
PS:
cc -o comp1 -g cg.c expr.c gen.c main.c scan.c tree.c