Compiler Changes?

FYI I noticed tonight a change to the compiler that may throw you for a loop, or maybe I’m going crazy:

Building locally I had to start adding the application.h and all of my non-class function prototypes at the top of the file application.cpp

When I went to the web IDE, it was also requiring these things… then I tried building some of my old known good files and they worked fine.

I went back to my new file and noticed I had a #define PIN D0 down in the middle of the file, so I moved that to the top and commented out the new application.h and prototypes and it compiled.

But then I moved the #define back to the middle of the file and it STILL compiled.

So now I’m back to not having to include the application.h and prototypes in the web IDE … but what was that a second ago where it WAS requiring it?

:eyes:

Hmm, I seem to be able to reproduce this effect more simply.

Go here and CTRL+A the screen: https://gist.github.com/technobly/8469105/raw/0e478198a04ee785cad78234776e61407a18626c/sparkRSTriLED.cpp

Paste that into a new application on the web IDE and click verify:
https://www.spark.io/build/new

ERRORS!

Now uncomment lines 35-42 and re-verify…

SUCCESS!!

Now just delete lines 35-42 and re-verify…

SUCCESS AGAIN!!! WTH??? I AM CRAZY RIGHT??

Yeah, I’m seeing that too. Weeeird.

Haha that’s odd. This sounds like it fits in with a number of issues we’ve been seeing with our pre-processor and the way that it handles code that’s been commented out. I’m not sure I can pinpoint the exact cause of the issue but I can tell you that pre-processor fixes are on our sprint this week and I’m fairly confident this will get fixed shortly.

Sounds like today is going to be a compile-service day for me! :smile:

edit: while I wasn’t able to exactly reproduce the results seen above, there are some pre-processor bugs that I haven’t had time to address, so I’ll look into those today.