windelbouwman / ppci

A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
https://ppci.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
335 stars 35 forks source link

ppci-cc: ++ and -- should work for floating point types #103

Closed tstreiff closed 4 years ago

tstreiff commented 4 years ago
float f;
++f;
  ^ Expected integer or pointer

++ and -- should work on any expression for which exp += 1 is legal. From the C standard: "The expression ++E is equivalent to (E+=1)." And += supports either: pointer += integer or: arithmetic += arithmetic.

windelbouwman commented 4 years ago

I copied your change, and added some test cases.

tstreiff commented 4 years ago

I have just checked and it works! thanks!