c - Error trying to define a 1,024-bit (128 Byte) Bit Field -


I would like to define a large bitfield for the purpose of monitoring the position of a very large structure of elements That I have so far:

 #define TOTAL_ELEMENTS 1021 type-ff straight UINT1024_tag {UINT8 byte [128]; } UINT1024; Type-Ff Structure flags_tag {UINT1024: TOTAL_ELEMENTS; } Flags_t; 

When I try to compile it, I get an error message, "Error: bit-field` is an invalid type of & lt; anonymous & gt;"

Can bit-fields be used only in some types? I thought that if I have defined a large enough variable, then the big bitfield required for my application can be defined because bitfield should not be bigger than the type used to define it.

Any ideas or suggestions will be appreciated.

Bit fields should fit within the same int, you can not use arbitrary shapes. Honestly the ANSI BitField implementation is slightly broken. It also remembers many other things, such as padding and layout control, which is usually needed by real-world applications, about some macros or accelerator functions to summarize large sizes and leave bitphilter syntax. I think.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -