c - Placeholder for hardware reserved registers in struct -


i have struct represents set of hardware registers. here, parts reserved , must neither written nor read. there placeholder or similar instead of using obvious variable naming?

typedef volatile struct registerstruct {   uint8 bdh;   uint8 bdl;   ...   uint8 ir;   uint8 reserved0; // area should not accessed   ... } 

obvious naming right thing use, there's no "reserved" feature in c.

you can use arrays of byte-sized integers correctly pad right length:

typedef volatile struct registerstruct {   uint8_t bdh;   uint8_t bdl;   uint8_t ir;   uint8_t __reserved[num_of_reserved_bytes]; // area should not accessed   uint8_t next_register_name; }; 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

1111. appearing after print sequence - php -

android - How to create dynamically Fragment pager adapter -