This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Call problem..
- To: kanata <kanata at celab1 dot ee dot ntou dot edu dot tw>, bug-gcc at gnu dot org
- Subject: Re: Call problem..
- From: Benedetto Proietti <benedetto dot proietti at roma1 dot infn dot it>
- Date: Tue, 13 Jun 2000 11:26:41 +0200
- References: <200006130921.RAA12588@celab1.ee.ntou.edu.tw>
kanata wrote:
>
> Hi All,
> Sorry to bother you again..
> If I want to call a specified address, how can I do it?
> I have use this way
> (char *)(0x12345678)();
> But compiler said "called object is not a function"...
> So How can I call a function without define?
>
> Thanks for your kindly support...
> Kanata.
Hope this can help you...
You have to cast the constant to the kind of function you want to call.
...however I suppose this isn't the right maillist for this question...
:)))
typedef void (*const_call)(int,...);
int main()
{
int arg1,arg2,arg3;
((const_call)0x12345678) (arg1,arg2,arg3);
return 0;
}
Bye
benedetto