This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

indirect call , parameter do not fit within register

Hi: I comply my program can such error message appeard"indirect call , parameter do not fit within register" what this mean.

This message appear becasue I define an function pointer in a structure and use the function in the main routine. The program is as below:

int aaa(int x,int y) { int z; z=x+y; return(z); }

typedef structure{ short i; int (*aaa)(int x, int y); } bmp085;

bmp085 tmp_bmp085;

main() { int abc; int a=1; int b=2; bmp085 *t_bmp085=0; t_bmp085=&tmp_bmp085; abc=t_bmp085->(*aaa)(a,b); // error }

why the error occur?

Thanks for your replying!

Jason

Parents
  • hi,
    put your code in

     and
    

    so that it will be readable
    OK, taling about your problem, we need to assign function pointer with some other function
    eg:
    void *fn();//declare
    fn1(); //some other function
    fn = &fn1;//function assignment
    and then use it

    bye

    take care

Reply
  • hi,
    put your code in

     and
    

    so that it will be readable
    OK, taling about your problem, we need to assign function pointer with some other function
    eg:
    void *fn();//declare
    fn1(); //some other function
    fn = &fn1;//function assignment
    and then use it

    bye

    take care

Children