case 59: // call0 ( &func -- *func() )
i = TOS;
+GCC_DIAG_OFF(int-to-pointer-cast);
TOS = (*(int16_t(*)(void)) i) ();
+GCC_DIAG_ON(int-to-pointer-cast);
break;
case 60: // call1 ( a &func -- *func(a) )
i = TOS;
j = NOS;
+GCC_DIAG_OFF(int-to-pointer-cast);
NOS = (*(int16_t(*)(int16_t)) i) (j);
+GCC_DIAG_ON(int-to-pointer-cast);
popMathStack();
break;
i = TOS;
j = NOS;
k = STACK(2);
+GCC_DIAG_OFF(int-to-pointer-cast);
STACK(2) = (*(int16_t(*)(int16_t, int16_t)) i) (k, j);
+GCC_DIAG_ON(int-to-pointer-cast);
TOS = 1;
ndropFunc();
break;
j = NOS;
k = STACK(2);
m = STACK(3);
+GCC_DIAG_OFF(int-to-pointer-cast);
STACK(3) = (*(int16_t(*)(int16_t, int16_t, int16_t)) i) (m, k, j);
+GCC_DIAG_ON(int-to-pointer-cast);
TOS = 2;
ndropFunc();
break;
k = STACK(2);
m = STACK(3);
n = STACK(4);
+GCC_DIAG_OFF(int-to-pointer-cast);
STACK(4) = (*(int16_t(*)(int16_t, int16_t, int16_t, int16_t)) i) (n, m, k, j);
+GCC_DIAG_ON(int-to-pointer-cast);
TOS = 3;
ndropFunc();
break;
case 76: // init ( &config -- ) \ clears buffers and calls msp4th_init
*lineBuffer = 0; // if location is same, the call is recursive otherwise
+GCC_DIAG_OFF(int-to-pointer-cast);
msp4th_init((struct msp4th_config *)popMathStack());
+GCC_DIAG_ON(int-to-pointer-cast);
break;
case 77: // o2w ( opcode -- ) \ leaves name of opcode in wordBuffer
void msp4th_init(struct msp4th_config *);
void msp4th_processLoop(void);
+/* Suppress specific warnings (callX words use function pointers)
+ *
+ * from:
+ * Suppressing GCC Warnings, by Patrick Horgan
+ * http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
+ */
+
+#if !defined(MSP430) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
+#define GCC_DIAG_STR(s) #s
+#define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y)
+# define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
+# define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
+# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
+ GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
+# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
+# else
+# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
+# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x))
+# endif
+#else
+# define GCC_DIAG_OFF(x)
+# define GCC_DIAG_ON(x)
+#endif
+
#endif