[chuck-users] bus error when declaring variables in same line

eduard aylon eduard.aylon at gmail.com
Thu Jun 15 22:25:30 EDT 2006


Hello there,

I have spent hours trying to figure out where a "bus error" came from.
I remember I once had a similar problem (don't know if it gave the  
very same error message, but it was regarding the same issue ) and  
thought it was solved on new releases.
Anyway an example will be more explanatory:

class foo
{
     gain g1, g2;
     fun void do_nothing(){}
}

foo f; // declaring is not a problem
f.do_nothing(); // calling any member gives a bus error

if you compile the example above it will give you a bus error. To  
solve it, one must declare the two gains in separate lines:

class foo
{
     gain g1;
     gain g2;
     fun void do_nothing(){}
}

foo f;
f.do_nothing();

maybe everyone is aware of it,  but just in case someone isn't, I  
think it will save him/her a lot of "debugging" time.
Could this behaviour be changed?

Eduard


More information about the chuck-users mailing list