C51 COMPILER V9.53.0.0 LX51 LINKER/LOCATER V4.66.30.0
I have the following (relevant) lines of code:
extern xdata uint8_t rtu_rx_buf[]; extern xdata uint8_t rtu_tx_buf[]; . . . struct{ uint8_t func; uint16_t start; uint16_t qty; uint8_t n; }xdata *p = &rtu_rx_buf[1]; . . . p = rtu_tx_buf; . . .
The first assignment to 'p' doesn't raise any complaints from the compiler or linker. The second, however, gives me the following warnings:
*** WARNING C182 IN LINE 98 OF C:\blahblahblah.c: pointer to different objects *** WARNING L25: DATA TYPES DIFFERENT
I'm pretty sure I don't see the difference; am I missing something here?
Leaving aside xdata:
p is a pointer to a struct;
rtu_tx_buf is an array.
Clearly, these are different objects ?
Don't you need some casting in there ?