It may be because ptr2func is not declared before the prototype. Try putting
the typedef of ptr2func in the header file above the prototypes.

--John


On Sat, Nov 7, 2009 at 12:07 PM, don clay <donc...@earthlink.net> wrote:

> 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.
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> AVR-GCC-list@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to