| ||||||||
Technical Support Support Resources Product Information | C51: WARNING 259 (POINTER: DIFFERENT MSPACE)Information in this article applies to:
SYMPTOMSI have a pointer that points to a variable in xdata and I am reassigning it to point to a variable in idata. The compiler is giving me WARNING 259: POINTER: DIFFERENT MSPACE RESOLUTIONWhen you reassign a pointer to point to a different memory space, you must cast the address of the variable to the memory space of the pointer. When you then wish to alter the variable via the pointer, you must cast the pointer to the memory space of the variable. For example: unsigned char idata bar = 2; unsigned char xdata *ptr; ptr = (unsigned char xdata *) &bar; *(unsigned char idata *)ptr = 3; // bar = 3 MORE INFORMATION
Last Reviewed: Friday, July 15, 2005 | |||||||
| ||||||||