AnsweredAssumed Answered

VisualDSP++ 5.0: problems with union in Expressions window

Question asked by vix on Jan 28, 2010
Latest reply on Nov 5, 2014 by vix

I've recently noticed a big problem when you try to view unions into Expressions window (VisualDSP++ 5.0 Update 7)

 

If you define

struct {
    union {
        u32        A;
        u32        B;
    }c;
} abcd;

you're able to view in Expressions window both abcd.c.A and abcd.c.B.

 

But if you define

struct {
    union {
        u32        A;
        u32        B;
    };
} abcd;

without giving an explicit name to the union, the Expressions window isn't able to show neither abcd.A, nor abcd.B.

The compiler works well because I checked the values into memory window, but the Expressions window gives

ERROR: Unknown member of struct/union/class

but this is false!

 

I use this kind of definitions very much because the C code to access data is more compact and so readable (abcd.A is better than abcd.c.A, because the "c" hasn't any specific meaning).

All the other IDEs I've been using (for microcontrollers, PC executables, ...) don't have any problems resolving this syntax.

Is there a way to fix this issue?

Outcomes