#define adr(x) ((word) &(x)) char tmsec[20]; struct par_struct AL[] = { //par.nr, lv, ln, eh, adress bk, pt, ft { 1, 2, 8, 0, 0, ptUSER, 40}, { 2, 2, 8, 0, 0, ptUSER, 41}, { 3, 2, 1, 0, 0, ptUSER, 42}, { 4, 0, 0, 1, adr(Tmsec), };
"You'll have to cite me chapter and verse of the standard you base that claim on before I agree that the address of an object qualifies as a compile time constant suitable for use as an initializer for a static (non variadic-array) object." Surely it must be so - otherwise how would we do tables of function pointers...? As well as assigning addresses, the linker also fixes-up references to those addresses; therefore, the compiler can take the address of an object as a copile-time constant. Well, that's what I think, anyway... ;-)