...
This noncompliant code uses the assert() macro to assert a property concerning a memory-mapped structure that is essential for the code that uses this structure to behave correctly.
| Code Block | ||
|---|---|---|
| ||
struct timer {
uint8_t MODE;
uint32_t DATA;
uint32_t COUNT;
};
int func(void) {
assert(offsetof(timer, DATA) == 4);
}
|
...