BlocklyProp icon indicating copy to clipboard operation
BlocklyProp copied to clipboard

Implement typing in blockly variables

Open PropGit opened this issue 6 years ago • 4 comments

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: image

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'

PropGit avatar Oct 04 '18 15:10 PropGit