parallaxinc / Simple-Libraries

Contents of the SimpleIDE workspace folder and its Parallax Learn Simple Libraries subfolder.
http://learn.parallax.com/propeller-c-set-simpleide/update-your-learn-folder
21 stars 21 forks source link

remainder reserved word #176

Closed Steph-Parallax closed 5 years ago

Steph-Parallax commented 5 years ago

Naming a variable "remainder" throws this compiler error

image

image

Steph-Parallax commented 5 years ago

Generated C.

/ SERIAL_TERMINAL USED /

// ------ Libraries and Definitions ------

include "simpletools.h"

// ------ Global Variables and Objects ------ int quotient; int remainder;

// ------ Main Program ------ int main() {

quotient = (10 / 3); remainder = (10 % 3); print("%s%d%s%d\r", "quotient = ", quotient, " and remainder = ", remainder);

}

Steph-Parallax commented 5 years ago

Oh, let me try this in Demo. It may actually be caused by a different bug in the print multiple block that isn't in production yet.

Steph-Parallax commented 5 years ago

Tested in Demo, it gets the same error message. So it is not related to blocklyprop #1538

AndyLindsay commented 5 years ago

This is in Propeller GCC

define remainder(x,y) __TGMATH_REAL_2(x, y, remainder)

I'd recommend adding 'remainder' to the reserved words list in blocklyprop.

Steph-Parallax commented 5 years ago

Thanks! I'll open an issue over there and link to this.