Re: [LIP] Function pointers not implemented on PPC ?

Shridhar Daithankar <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>
On Tuesday 06 January 2004 17:14, Kapil Sethi wrote:
> > On Tuesday 06 January 2004 16:31, Kapil Sethi wrote:
> > Shouldn't that be void test(void) for standards sake?
>
> I need to pass arguments to the called function, anyway gcc or
> ppc-linux-gcc does not give any warnings for the same.

In that case declare the arguments. My point was don't put a empty arguments 
list there.
>
> > > void main()
> > > {
> > >     void (* myfunc)();
> > >     myfunc=&test;
> >
> > make that myfunc=test;
>
> This is what is creating problem. both myfunc=test and myfunc=&test
> compiles and executes as expected using gcc.
> however ppc-linux-gcc gives error with myfunc=&test ->
> <error>
> invalid lvalue in unary '&'
> </error>
> while with myfunc=test compiles, but gives segmentation fault on running.

Put a proper function prototype and retry.

 Shridhar



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.