LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing anonymous struct members in "Completions"

I have noticed that LabWindows/CVI 2019 does not give "completions" on anonymous struct members.
For example, consider the following code:

 

typedef union {
    struct _namedstruct {
        double a;
        double b;
    } namedstruct;
    double array[2];
} NAMED;

typedef union {
    struct {
        double a;
        double b;
    };
    double array[2];
} ANONYMOUS;

void main()
{
    NAMED     named;
    ANONYMOUS anon;
    
    named.namedstruct.a = 1.0;
    anon.a = 2.0;
}

 

 

when I write the first assignment I have correctly proposed on first dot both the members of the union:
named1.png

and on the second dot the struct members:
named2.png.
When I enter the second assignment, keying the dot I get only the named member, but not the members of the anonymous struct, as I would expect.
anon.png

I found this very annoying because I use often this scheme in my code, I think it improves the readability of code.
Is this behavior wanted or is it a bug?


Carlo A.
Megaris




0 Kudos
Message 1 of 2
(2,578 Views)

I find that anonymous structs and unions have always behaved strangely in C. It depends a lot on the compiler.

0 Kudos
Message 2 of 2
(2,429 Views)