I think there is a bug with our compiler that is making the syntax a little awkward–we’ll work to improve it to make the experience more like the standard Arduino IDE. In the meantime, I’m seeing the code compile in my IDE by adding (unsigned char) in front of DEC, as in
../4b7afec1a7ff16d6558a1426739ef992ca03411e8c9cf2a64b09c524fcde/the_user_app.cpp:33:15: error: missing terminating " character [-Werror]
../4b7afec1a7ff16d6558a1426739ef992ca03411e8c9cf2a64b09c524fcde/the_user_app.cpp:33:1: error: missing terminating " character
../4b7afec1a7ff16d6558a1426739ef992ca03411e8c9cf2a64b09c524fcde/the_user_app.cpp:36:1: error: expected primary-expression before 'void'
../4b7afec1a7ff16d6558a1426739ef992ca03411e8c9cf2a64b09c524fcde/the_user_app.cpp:36:1: error: expected ',' or ';' before 'void'
cc1plus: all warnings being treated as errors
make: *** [../4b7afec1a7ff16d6558a1426739ef992ca03411e8c9cf2a64b09c524fcde/the_user_app.o] Error 1
Removing the compiler flag “-Werror” (Warnings as Errors) in the build script should fix the compiler error “cc1plus: all warnings being treated as errors”
Yes, but only in the core-firmware repo. In core-common-lib and core-communication-lib, we don’t use the -Werror flag.
Hmm… we are using that flag in an attempt to help people write better code—including, as @Dave says, to prevent what we expect will be common mistakes. Without it, some hard-to-debug cases will silently creep into user apps.
Dear Spark Community—what do you think? Should we remove it? Down the road we could make it an option in the web IDE, like with a checkbox or something, but for now, we need the most sensible default. Vote +1 to remove -Werror or -1 to keep warnings failing the build.
Sorry, just put that text “+1” or “-1” in a reply in this thread. Definitely user configurable down the road, but let’s vote on the default until then.
It’s going to be a PITA to port some libraries over with -Werror on, so I say remove for now and keep as an option. You’ll still be able to see the warnings in the compile output, but if the compile is erring out it does me no good.
+1. I like the idea of showing the errors in the debug console even when the compile succeeds, but that requires some changes to the web IDE, so the quicker fix will just be to switch the flag.
This outputs semirandom character between “Potato” and 42.
In bigger app I got “PotatoL42” and now with this bare example I get “Potato¼42”.
I was debugging my led matrix and I thought that it or the library was defective, but now that Serial works, it seems the String indeed gets that extra character in this operation.
I now use char[] and sprintf etc., but String would be easier to use if it works properly.
I didn’t have local build enviroment ready and it took a bit longer to set up than I expected. Meanwhile @Raldus already spotted the same thing, but my solution was to add alternative function calls in if-else.
That works, but my virtual machine setup seems too unstable so I can’t test Radus’s version. (I can compile and flash stuff, but Core keeps resetting to listening mode even if I give it Wifi credentials.)
@Raldus’s version also works. Turned out that my build system was all good, but my router had different settings than I remembered.