#1530 Error when using xdata function parameters

closed-fixed
5
2013-05-25
2009-04-14
kjell eirik
No

In the following example func1 is called correctly but not func2. It seems that using xdata function parameters only work correctly when the function called is in the same file as the code which does the call.

Compiled with sdcc version 2.8.0 :
(Also fails with sdcc-snapshot-i586-mingw32msvc-20090406-5427.zip)
sdcc -mmcs51 --model-small -c file1.c
sdcc -mmcs51 --model-small -c file2.c
sdcc -mmcs51 --model-small --code-loc 0x0000 --xram-loc 0x3000 file1.rel file2.rel

Best regards,
Kjell Eirik Andersen
kjell.e.andersen@gmail.com

// file1.c
volatile char xdata xx1;
volatile short int xdata xx2;

extern void func2( char xdata p1, int xdata p2 );

void func1( char xdata p1, int xdata p2 )
{
xx1 = p1;
xx2 = p2;
}

main()
{
func1( 14, 16 );
func2( 19, 11 );
return 0;
}

// file2.c
volatile char xdata yy1;
volatile short int xdata yy2;

void func2( char xdata p1, int xdata p2 )
{
yy1 = p1;
yy2 = p2;
}

Discussion

  • Maarten Brock

    Maarten Brock - 2009-11-04

    Fixed in SDCC 2.9.4 #5566.

     
  • Maarten Brock

    Maarten Brock - 2009-11-04
    • labels: --> C-Front End
    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     

Log in to post a comment.