[cc65] Pointer to function : help needed

From: <jlsfjs1yahoo.fr>
Date: 2004-09-16 14:17:13
Hello, this is my first post on this list, and my first problem tooo ! ;-)
I'm coding on apple2 and using xkegs for the tests.

Is there something special when using pointer to functions ?

I have a struct with several fields containing pointers to functions and want to call them 
when needed. For example :

struct linklayer_driver 
{
	void (*drv_open)();
}

Is used like that

struct linklayer_driver driver;
driver.drv_open  = &foo_open;

with foo_open() declared as :
void foo_open();

And several kilometers later I do :

link_driver.drv_open();


No warnings, no errors at compile time... BUT, there must be something strange 
because printf calls doesn't work anymore. The first printf in the code does its job but 
no the next ones. The result goes from crash (monitor), to infinite garbage or nothing 
at all..


I presume I must do something bad...


Any help appreciated, thank you


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 16 14:17:15 2004

This archive was generated by hypermail 2.1.8 : 2004-09-16 14:17:24 CEST