n += TO_OR_CIRCUIT((circuit_t*)c)->p_chan_cells.n;
And that warning usually means that you're calling TO_OR_CIRCUIT with a const pointer when it only takes a non-const one. But we are calling it with a non-const pointer -- we're casting c to circuit_t*.
This warning doesn't seem to occur on other platforms, as far as I know. Could the FreeBSD gcc be doing something unusual here?
Could the FreeBSD gcc be doing something unusual here?
That I don't know. FreeBSD typically uses older gcc's for their base, backport select gcc patches into it, and do what they need for FreeBSD.
I just checked and this warning goes away when using gcc 4.6.4 from their packages (added CC and CPP env vars to the 4.6.4 bins).