Keil C does not support this line:
typedef const UINT32 volatile xdata *PCVX32;
typedef const volatile UINT32 xdata *PCVX32;
"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...
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;
I *think* that the following: typedef const long volatile *pclVal0; typedef const char volatile *pclVal1; are correct and should compile. The fact that int and short work makes me suspect that there is something going wrong due to to the fact that: const abc; is equivalent to: const int abc; ie the compiler's 'default to int' mechanism is being incorrectly invoked. Interestingly the same problem occurs with: volatile long const *abc;
just curious How can something that is constant be volatile Erik
"just curious How can something that is constant be volatile" We flogged this to death before. In the 'C' programming language const!=constant. Just accept it.
View all questions in Keil forum