0

I am trying the example of c_expr manual page (https://spinroot.com/spin/Man/c_expr.html).

The example is following as:

c_code {
    int fct(void) {
        return 1;
    }
}

active proctype ex1()
{   int x;

    do
    :: c_expr { Pex1->x < 10 } -> c_code { Pex1->x++; }
    :: x < 10 -> x++
    :: c_expr { fct() } -> x--
    :: else -> break
    od
}

However, after I execute the command following as:

$ spin -a test.pml

the error message is printed:

spin: test.pml:13, Error: c_expr c_code4 has side-effects near 'c_expr'

I don't know what is wrong.

Would you please tell me how I correct the code or an correct example?

backpacker
  • 43
  • 3

0 Answers0