Spinroot

A forum for Spin users

You are not logged in.

#1 General » Passing array to an inline macro » 2011-03-11 15:00:45

miss_mare
Replies: 6

Hello

I have a problem concerning inline macros and spin 6.01. I used to pass a whole array to an inline macro such that recurring work could be done there. But spin 6.0.1 doesn't let me pass a whole array anymore, but requires a specific element. Is there a way how I can still pass a whole array to an inline macro?

Kind regards

Here is a minimal example, which works in spin 5.2.5 but not with spin 6.0.1

mtype {start, end};
chan chs[2]=[1] of {mtype, byte};

inline parallelsplit(chs_out, num_out, msg, id) {
  byte i;
  i=0;
  do
  :: i< num_out ->
      chs_out[i]!msg,id;
      i++;
  :: i== num_out ->
      i=0;
      break;
  od;
}

active proctype A() {
  mtype msg; byte id;
  msg = start;
  id=1;
  parallelsplit(chs, 2, msg, id);
}

Spin 6.0.1 finds the following error:

spin: test.pml:21, Error: missing array index for 'chs'    saw '',' = 44'

Board footer

Powered by FluxBB