BlocklyProp
BlocklyProp copied to clipboard
Implement typing in blockly variables
The Print text block happily accepts a non-string variable (non-char*) and succeeds in compiling but causes ugly warning and of course won't work as user expected.
This project:
produces this code:
/* SERIAL_TERMINAL USED */
// ------ Libraries and Definitions ------
#include "simpletools.h"
// ------ Global Variables and Objects ------
int item;
// ------ Main Program ------
int main() {
print(item);
}
and this response at compile time:
Compile... Succeeded.single.c: In function 'main': single.c:16:3: warning: passing argument 1 of 'print' makes pointer from integer without a cast [enabled by default] /opt/parallax/Workspace/Learn/Simple Libraries/TextDevices/libsimpletext/simpletext.h:309:5: note: expected 'const char *' but argument is of type 'int'