keyvank / 30cc

30 C Compiler
52 stars 6 forks source link

Allow assigning 0 to pointer types #12

Closed keyvank closed 3 weeks ago

keyvank commented 1 month ago

C lets you to do this:

int *a = 0;

30cc gives a type error. We should exceptionally allow assigning the value of 0 to pointer types. (Values greater than 0 should be prevented though)