avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] passing pointers to functions


From: don clay
Subject: [avr-gcc-list] passing pointers to functions
Date: Sat, 07 Nov 2009 13:07:40 -0700

I have been having difficulty passing a function pointer in a function call.  
In 
researching the issue, it appears that there is a compiler issue with doing 
that & 
I've tried a couple of suggested fixes with no luck.

Since the version appears to required in order to get the correct fix, my 
version 
is gcc-4.3.0.

This is my last attempt.

1.  Here is the function prototype in the .h file

void InsertTask(ptr2func TaskPtr);                      // line 42 in atm328.h

2.  Here is the code in the single .c file containing all the code related to 
this 
issue.

typedef void (*ptr2func)(void);

Here is the function

void InsertTask(ptr2func TaskPtr)

Here is the call

        InsertTask(LEDTask);    


3. Here is the returned error.

../atm328.h:42: error: expected ')' before 'TaskPtr'


Before I try updating avr gcc, is there something else that I need to do in 
order 
to make this work?

thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]