iar pointer
YOU SHOULD BE HAPPY THAT THE COMPILER COMPLAINS!!!
Well yes you will have the problem with all compilers
this is not right
p = (unsigned short int)0x0192)
if you have a pointer declared as unsigned char *p and want to point to the adress 0x0192
do this
p = (unsigned char *) 0x0192 ; and if you want to get the byte of data contained at that address do this
val = * (unsigned char *) 0x0192 ;
very simple ..You have to CAST the number 0x0192 to be a pointer address otherwise is just a NUMBER in ASCII not an int ! (it has never beed declared as int). and the compiler doesn't know what you want. One thing to remember is that a pointer is not just an address but is implemented as a header with an address .specially in micronctrollers where there are a lot of memory spaces (CONST FLASH ,RAM ,EPROM etc) so sometimes you have to cast it with also the type of memory space
for example
CONST char *FLASH_PTR ;
char *myRAM_ptr .But if you want to pass the address of one to the other :
myRAM = FLASH_PTR ... the compiler (a good one ) will COPMPLAIN