keyvank / 30cc

30 C Compiler
52 stars 6 forks source link

better aproach to read source file, introduce xfree macro and some error handling #1

Closed thehxdev closed 2 months ago

thehxdev commented 2 months ago

Wrote seperate function to read source files named read_source_file(FILE *fp). checked for NULL pointers, closed open files and print all tokens after tokenization phase. Also introduced xfree(p) macro to avoid double free memory error.

Changed Makefile to add CFLAGS to include useful debug information and enabled all compiler warnings.