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

error: #28 expression must have a constant value

I have used the trail and full Uvision3 ARM compiler.
The following code produces the error
'expression must have a constant value' at the indicated position below.
The same code compiled on about 5 other different compilers(microchip, borland, microsoft etc) results in no error.

Can anyone help.


///////////////////
typedef struct
{
unsigned char A;
unsigned char B;
unsigned char C;
unsigned char *STR;
unsigned char L;
long F;
}EDIT;

typedef struct
{
unsigned short S;
void* (*ptr)(void*);
unsigned char *BI;
unsigned char IDx;
unsigned char IDm;
unsigned short M;
unsigned short tMask;
unsigned short *tStatus;
}FUNCTION_KEY;

unsigned char NullCall(void){return 0;}

int main(void)
{
EDIT Profile=
{
2,
20,
8,
"\x12",
14,
0x12345678
};

FUNCTION_KEY FKey_Title[1]=
{
0x1234, (void*(*)(void*))&NullCall,
"\x30",
0,
1,
0x1234,
0x1234,
(unsigned short*)&Profile.F, // error: expression must have a constant value
};
}

0