Bug #14502 2008-09-15 12:51

collins2

Union and bit struct = CodeCompletion doesn't work

Hi!

I use C::B last NB=5195.

Because I develop software for microcontrollers I really

often use bit structures which are item of unions.

C::B'c codecompletion doesn't work correctly with

this structures.

I've used DevC++ 4.9.9.2 earlier and I've found that

codecompletion has the same problem with union,

but bit structures are prompted correctly.

Try this code:

typedef union

{

unsigned char bX;

struct

{

bitX0:1,

bitX1:1,

bitX2:1,

bitX3:1,

bitX4:1,

bitX5:1,

bitX6:1,

bitX7:1;

} bitX;

} TunionX;

TunionX unX;

unX. >>>>>> dosen't work

unX.bitX. >>>>>> dosen't work

typedef union

{

unsigned char bYA[2];

unsigned short wY;

} TunionY;

TunionY unY;

unY. >>>>>> dosen't work

Best regards,

Collins

Category
Plugin::CodeCompletion
Group
 
Status
Closed
Close date
2010-10-15 13:10
Assigned to
loaden
geister 2008-09-21 06:33

SVN 5208

Giving a type to your bitX0..7 might help. Have you tried compiling it? It fails. =P

May I suggest the following instead:

typedef union

{

unsigned char bX;

struct

{

char bitX0:1;

char bitX1:1;

char bitX2:1;

char bitX3:1;

char bitX4:1;

char bitX5:1;

char bitX6:1;

char bitX7:1;

} bitX;

} TunionX;

After browsing plugins/codecompletion/parser/parserthread.cpp I noted that unions are not being added to the symbols browser. I guess this had been known for a while though.

loaden 2010-10-15 13:10

This bug is now fixed in HEAD.

Thank you for reporting it.