rui314 / 8cc

A Small C Compiler
MIT License
6.13k stars 740 forks source link

Pointer comparators and difference match the C standard. #22

Closed andrewchambers closed 9 years ago

andrewchambers commented 9 years ago

Fixed two issues with pointer operations. C11 6.5.6.9: Ptr subtraction have type ptrdiff_t. C11 6.5.8.6, 6.5.9.3: Ptr comparisons have type int.

andrewchambers commented 9 years ago

fixed sizeof(8) crap. ran fulltest all ok.

andrewchambers commented 9 years ago

If you didn't notice, I also renamed the ptr_compare() to compare() because pointer_compare is redundant in pointer.c and it is inconsistant with subtract() above it.

rui314 commented 9 years ago

Rebased and merged.

rui314 commented 9 years ago

You may want to check your git config. Your name is not capitalized in the commit logs. ("andrew chambers" instead of "Andrew Chambers".)

andrewchambers commented 9 years ago

Thanks, I commit from about 5 different machines and it has been a pain to keep everything in sync. I'll update all my configs and make sure the commit name and email are the same for future commits.

Also, thanks for the merge, I'll be really pleased when 8cc can compile more large programs. It is quite sad there is no free C validation suite with both positive and negative cases, tcc has a test suite that seems worse than 8cc's one. gcc just has a huge regression suite, not really a validation suite.