problem with the initialization of pointers sitting in
ROM:
-----------------------------
char ch;
// Pointer in RAM: ok
char* p4 = (char*)(&ch);
// Pointer in ROM: this line results in
// tt2.c(9):warning *** Initializer different levels of
indirections
// and no code is generated
char* const p5 = (char*)(&ch);
// but this line works???
char* const p6 = &ch;
----------------------------
sdcc --version:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic14/i186/tlcs900h/TININative/xa51
2.3.1 (Feb 11 2002) (UNIX)
Any hints?
Corvin
Logged In: YES
user_id=63512
Fixed in SDCCglue.c:1.107
This isn't perfect yet. You can e.g. not do "char * code p5=
(char code *)(&ch)" because the cast is simply ignored but
a warning is thrown in that case, just like with "char *
code p5=(char code *)0x1234".
So I moved this one to the feature requests.
Johan
Somewhere along the lines of 14 years of development for SDCC this was fixed.