When a generic pointer is initialized with an absolute
address, SDCC always assigns type 0 (DSEG), regardless
of casting the address to a particular memory type.
Here's an example:
unsigned char pointer_test(void)
char * some_generic_pointer = (xdata char
This mcs51 code is generated:
mov dptr,#(((0xFF)<<8) + 0x04)
mov b,#0x00 ;BUG:
should by 0x01
Also, printing a warning when the user doesn't give any
memory type would be the nice thing to do, instead of
silently assuming it's a pointer to DSEG.
Log in to post a comment.