View previous topic :: View next topic |
Author |
Message |
glenjoy
Joined: 18 Oct 2004 Posts: 21
|
Error at this line when compiling.. |
Posted: Mon Feb 28, 2005 2:32 am |
|
|
I cannot compile this initialization of function, why is that?
void n61_init(int (*func)(int cmd, unsigned char c)); |
|
|
glenjoy
Joined: 18 Oct 2004 Posts: 21
|
|
Posted: Mon Feb 28, 2005 7:10 am |
|
|
I think even CCS persons cannot answer my question, another bug? |
|
|
valemike Guest
|
Re: Error at this line when compiling.. |
Posted: Mon Feb 28, 2005 8:12 am |
|
|
glenjoy wrote: | I cannot compile this initialization of function, why is that?
void n61_init(int (*func)(int cmd, unsigned char c)); |
Is this supposed to be a function that takes a pointer to a function that takes an integer and unsigned char argument, and returns void?
Whatever it is i think i just tried to babble, last i remember, CCS does not allow function pointers. |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Mon Feb 28, 2005 8:35 am |
|
|
The CCS compiler is NOT a full ANSI compliant compiler. Among its non-ANSI portions is its support for pointers to functions. Depending on the version of compiler you have it may or may not support them at all. And the support it does have is somewhat limited. It does however create a pointer to function automatically in switch() statements under the right conditions making state machines very efficient. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
|