Move val declaration to remove warnings.
int main (void) {
MIR_module_t m;
MIR_item_t func;
- MIR_val_t val;
double start_time;
const int64_t n_iter = 100000000;
MIR_context_t ctx = MIR_init ();
@@ -24,7 +23,6 @@ int main (void) {
MIR_output (ctx, stderr);
#endif
start_time = real_sec_time ();
- val.i = n_iter;
#if MIR_C_INTERFACE
typedef int64_t (*loop_func) (int64_t);
MIR_set_interp_interface (ctx, func);
@@ -32,6 +30,9 @@ int main (void) {
fprintf (stderr, "C interface test (%" PRId64 ") -> %" PRId64 ": %.3f sec\n", n_iter, res,
real_sec_time () - start_time);
#else
+ MIR_val_t val;
+
+ val.i = n_iter;
MIR_interp (ctx, func, &val, 1, val);
fprintf (stderr, "test (%" PRId64 ") -> %" PRId64 ": %.3f sec\n", n_iter, val.i,
real_sec_time () - start_time);
