I have a struct that is this:
#define REQUEST_SIZE_BITS 16
#define HID_SIZE_BITS 32
#define BLOCK_SIZE_BITS 16
#define FID_SIZE_BITS 32
typedef struct __attribute__((__packed__)) footer {
uint64_t block_size : BLOCK_SIZE_BITS;
uint64_t fid : FID_SIZE_BITS;
uint64_t requested_size : REQUEST_SIZE_BITS;
} footer;
But when I create a instance of this struct
footer prologue;
prologue->block_size = 16;
The compiler says that
Invalid type argument of "->"
Why is this happening?
Should I use
prologue.block_size = 16;
Instead of using
prologue->block_size
?
Also, what does
block_size : BLOCK_SIZE_BITS;
do when we define this struct? Is it assigning it a default value?