Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1412 generic static pointer dereference doesn't work

closed-fixed
Borut Ražem
5
2013-05-25
2007-12-16
Borut Ražem
No

failing test case:

static unsigned int Val = 0x1234;

int
test(void)
{
static unsigned int *pVal = &Val;

ASSERT(*pVal == Val);
}

the dereference works fine if the storage attribute is specified or the pointer is not static:

data static unsigned int *pVal = &Val;

or

unsigned int *pVal = &Val;

verified with sdcc version:
$ ../../bin/sdcc -v
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.4 #4977 (Nov 17 2007) (UNIX)

This is the reason why the regression test bug1399290 fails on pic16 target.

Borut

Discussion

  • Borut Ražem
    Borut Ražem
    2007-12-16

    Logged In: YES
    user_id=568035
    Originator: YES

    Fixed in svn revision #4979.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2007-12-16

    • milestone: --> fixed
    • assigned_to: nobody --> borutr
    • status: open --> closed-fixed