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

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

RE: [avr-gcc-list] passing pointers to functions


From: Weddington, Eric
Subject: RE: [avr-gcc-list] passing pointers to functions
Date: Sat, 7 Nov 2009 21:13:25 -0700

Two things:

1. IIRC, there was a problem with 4.3.0 unless you had the right patches. It 
may not be related to your problem, but we need to know what platform you're 
building on, and what patches are you using. You may need to upgrade.

2. We need to have a compilable test case, preferably as small as possible, 
that shows the error. There is not enough information here to tell you one way 
or the other what is going on with your code.

Honestly I suspect something in your code, and not the compiler.
 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of don clay
> Sent: Saturday, November 07, 2009 1:08 PM
> To: address@hidden
> Subject: [avr-gcc-list] passing pointers to functions
> 
> 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
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 




reply via email to

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