EmbeddedRelated.com
Forums

1.x to 3.x IAR compiler migration problem (compile error)

Started by mrusak1 July 5, 2007
I recently upgraded my IAR EW430 compiler to the latest version from a
very old 1.26 version. I am getting this compile error on a line of
code that did not have an error before.

The error is:

Error[Pe513]: a value of type "void *" cannot be assigned to an entity
of type "void (*)(void)"

and the line of code is:

task[j].detail.fun_ptr = (void *)in_ptr;

I would appreciate any help.

Thanks,
Mike

Beginning Microcontrollers with the MSP430

--- In m..., "mrusak1" wrote:
>
> I recently upgraded my IAR EW430 compiler to the latest version
from a
> very old 1.26 version. I am getting this compile error on a line
of
> code that did not have an error before.
>
> The error is:
>
> Error[Pe513]: a value of type "void *" cannot be assigned to an
entity
> of type "void (*)(void)"
>
> and the line of code is:
>
> task[j].detail.fun_ptr = (void *)in_ptr;
>
> I would appreciate any help.
>
> Thanks,
> Mike
>

fun_ptr is a void(*)(void) and in_ptr is an unsigned char *. How do
I cast in_ptr to a void(*)(void) in the latest compiler?
I usually do this with a typedef:

typedef void *functionType(void);

task[j].detail.fun_ptr = (functionType)in_ptr;

>> -----Original Message-----
>> From: m... [mailto:m...]
>> On Behalf Of mrusak1
>> Sent: Friday, July 06, 2007 11:59 AM
>> To: m...
>> Subject: [msp430] Re: 1.x to 3.x IAR compiler migration
>> problem (compile error)
>>
>> --- In m..., "mrusak1" wrote:
>> >
>> > I recently upgraded my IAR EW430 compiler to the latest version
>> from a
>> > very old 1.26 version. I am getting this compile error on a line
>> of
>> > code that did not have an error before.
>> >
>> > The error is:
>> >
>> > Error[Pe513]: a value of type "void *" cannot be assigned to an
>> entity
>> > of type "void (*)(void)"
>> >
>> > and the line of code is:
>> >
>> > task[j].detail.fun_ptr = (void *)in_ptr;
>> >
>> > I would appreciate any help.
>> >
>> > Thanks,
>> > Mike
>> >
>>
>> fun_ptr is a void(*)(void) and in_ptr is an unsigned char *.
>> How do I cast in_ptr to a void(*)(void) in the latest compiler?
>>
>> Yahoo! Groups Links
>>
>> This email was scanned with Mcafee's Anti-Virus appliance, but this
>> is no guarantee that no virus exists. You are asked to make sure you
>> have virus protection and that it is up to date.
>>