#300 sdcc crashes on this code

closed-fixed
Johan Knol
5
2013-05-25
2002-02-25
Anonymous
No

Hi !

I don't now if i am right, but I would like to create
a table where i will store pointers to my functions.
so if i compile code above sdcc crashes. Code is
written following by the sources from IAR compiler.

the code:
<------------------------BEGIN CODE>
#include "at89x52.h"
typedef struct MYSTRUCT
{
int T1;
int T2;
void (*fptr)(void);
}tMYSTRUCT;
void fun1(void)
{
P0=2;
}
void fun2(void)
{
P0=1;
}
//typedef MUS MYSTRUCT;
const tMYSTRUCT dane[]={
{12,13,&fun1},
{13,13,&fun2},
{144,145,&fun1}
};
void main(void)
{
while(1);
}
<---------------------END OF CODE>

Best regards - if there is any way to work it arround
any help welcome

Adam Bujnowski

Discussion

  • Johan Knol
    Johan Knol
    2002-02-26

    • labels: --> C-Front End
    • milestone: --> fixed
    • assigned_to: nobody --> johanknol
    • status: open --> closed-fixed