B
bart.vandewoestyne
Hello group,
Just as a fun-project and to learn new things, I've started writing my version of the Tiger compiler from the book 'Modern Compiler Implementation in C' by Andrew W. Appel. My code can be found at the following GitHub repo:
https://github.com/BartVandewoestyne/c/tree/master/books/Modern_Compiler_Implementation_in_C
With some help from code that I found on the Internet, I have finished everything from the first chapter now:
https://github.com/BartVandewoestyne/c/tree/master/books/Modern_Compiler_Implementation_in_C/chap01
Because I also consider this as an exercise in writing good C-style (more specifically C99), I would like to have my code reviewed. Please share me your thoughts on the following:
1) General comments concerning my C-programming style is greatly appreciated!
2) The maxargs.c and interp.c still give me the warning "control reaches end of non-void function". I know why this is, but I am wondering what wouldbe the cleanest way to get rid of this warning. Considering for example the function maxargs_expList from maxargs.c, i just *know* that expList->kind is only one of the two proposed values in the switch statement. If anything else appears, that is an error. What is in your opinion the best solution in this case, leading to code that compiles without warnings?
Thanks!
Bart
Just as a fun-project and to learn new things, I've started writing my version of the Tiger compiler from the book 'Modern Compiler Implementation in C' by Andrew W. Appel. My code can be found at the following GitHub repo:
https://github.com/BartVandewoestyne/c/tree/master/books/Modern_Compiler_Implementation_in_C
With some help from code that I found on the Internet, I have finished everything from the first chapter now:
https://github.com/BartVandewoestyne/c/tree/master/books/Modern_Compiler_Implementation_in_C/chap01
Because I also consider this as an exercise in writing good C-style (more specifically C99), I would like to have my code reviewed. Please share me your thoughts on the following:
1) General comments concerning my C-programming style is greatly appreciated!
2) The maxargs.c and interp.c still give me the warning "control reaches end of non-void function". I know why this is, but I am wondering what wouldbe the cleanest way to get rid of this warning. Considering for example the function maxargs_expList from maxargs.c, i just *know* that expList->kind is only one of the two proposed values in the switch statement. If anything else appears, that is an error. What is in your opinion the best solution in this case, leading to code that compiles without warnings?
Thanks!
Bart