#1659 cannot use generic pointer to initialize <null>

closed-fixed
Maarten Brock
5
2013-05-25
2010-07-25
Borut Ražem
No

sdcc throws the error:
error 151: cannot use generic pointer to initialize <null>

when compiling the following line:
char * correct() { return (char __code *) 0x1234; }

This bug is a side effect of fixing bug #3027957: "Subscript of pointer cast from const causes internal error."
If I revert the change in SDCCgluec, function aopLiteralLong(), the line compiles without error.

$ ../../sdcc.build/bin/sdcc -v
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 #5890 (Jul 25 2010) (Linux)

Borut

Discussion

  • Maarten Brock
    Maarten Brock
    2010-08-02

    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     
  • Maarten Brock
    Maarten Brock
    2010-08-02

    Fixed in SDCC 2.9.7 #5905.
    The error has been turned into a warning and moved from icode to ast level.