Keil C does not support this line:
typedef const UINT32 volatile xdata *PCVX32;
typedef const volatile UINT32 xdata *PCVX32;
OK, I'll look in a spec soon. And, it is not the side-effect of xdata.The following line can not be compiled either:
typedef const long volatile *pclVal0; typedef const char volatile *pclVal1;
typedef long volatile *pclVal0; typedef char volatile *pclVal1; typedef const short volatile *pclVal2; typedef const int volatile *pclVal3; typedef const volatile long *pclVal4; typedef volatile const long *pclVal5;
"but other ANSI C compilers support..." What other compilers? Do they have a "Strict ANSI" switch? Have you tried using it? Maybe this is a common error in other compilers, and just Keil have got it right...? Before quibbling about different compilers' implementations, have you checked what the ANSI spec actually says? Also, note that Keil have extended the language by adding support for storage-class specifiers (code, xdata, etc) - maybe it's a side-effect of this? Again, you need to refer to the ANSI spec for the definitive answer...
And if there is no "const", it's also OK.
The position of "volatile" is the aim.You can try
typedef const long volatile *PVLONG;
typedef const volatile long *PVLONG;
No ANSI C compiler supports UINT32 or xdata. Those have to be either something you have defined as being meaningful to you, or something they have defined as a language extension (or some combination).
View all questions in Keil forum