#718 Confusion of local and global var

closed-fixed
5
2013-05-25
2004-03-01
No

Hi.

Compilling the following code I get an absolutely
inadequate error message (which pretends to be a
warning though).

---
union progr_union {
char a;
unsigned char b[1];
} p;

unsigned char f(unsigned char i)
{
unsigned char val = p.b[i];
return 0;
}

char main()
{
return f(0);
}
---

$ sdcc undef.c
?ASlink-Warning-Undefined Global '_f_val_1_1'
referenced by module 'undef'

$ sdcc -v
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.3.8 (Feb 29 2004) (UNIX)

Example attached.

Discussion

  • Stas Sergeev

    Stas Sergeev - 2004-03-01

    Example

     
  • Erik Petrich

    Erik Petrich - 2004-05-21
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     
  • Erik Petrich

    Erik Petrich - 2004-05-21

    Logged In: YES
    user_id=635249

    Fixed in src/SDCCopt.c 1.49

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks