This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler Error 143: 'Scalar' : Initialiser is not a constant

#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),
};

It is a part of a parameter table of about 1500 elements.
When compiling this in C166, I am getting this error when the variable adr(x) is an array with more than 6 elements. In C51 this worked perfect.
I also tried to write directly ((word) &tmsec[0]) instead of adr(tmsec) with the define, but this did not help.

What is the reason that it does not work when "tmsec" is an array with over 6 elements ?

Hope anyone can help..

Joost