One way is to generate an error when the condition is not met. The main problem is if you can get an
error an unaware developer can detect on his own what the problem was.
I did use something like this in the past:
#define COMPILE_TIME_ASSERT(cond) extern int CompileTimeTest[(cond) ? 10 : 9]extern int CompileTimeTest[10];
It redeclares an array with a different numbers of elements, using the array name as first hint of the cause. And a lot of comments at the declaration location as second hint.
For the given case of placing a structure in memory I wonder if not the linker should actually warn about the problem? Maybe not if the external EEPROM is not known.
Daniel