Page 2 of 2

Re: Mutex in a struct?

Posted: 15 Mar 2012, 19:10
by nxtboyiii
mcsummation wrote:I made the macro handle the mutex issue.

However, I have another thing now:

Code: Select all

struct a {
    string b;
    string c[];
};
a aa;
string d[];
string e;
long l;
task main() {
e = FlattenVar(l); // This works.
d[0] = FlattenVar(l); // So does this.
aa.b  = FlattenVar(l);  // And, yet again, it works.
aa.c[0] = e; // This doesn't work.
aa.c[0] = FlattenVar(l);  // Neither does this.
}
Why don't the last two work? The next to the last says "Data types are not compatible". The last one gives that plus a couple of other errors which would be secondary issues.
Wow, that makes no sense why it does not work. Weird...

Re: Mutex in a struct?

Posted: 15 Mar 2012, 22:27
by afanofosc
The last two don't work because my compiler's homegrown parsing code isn't written to handle that particular syntax. But even if it did handle that syntax you would likely run into strange crashes that could be a compiler defect or a firmware defect related to complex structs - where "complex" means "containing 2d arrays" (and maybe other things too). Remember that an array of string is a 2d array of byte. My advice?

KISS.

John Hansen