Re: [arm-gnu] arm-none-eabi-g++ compile the following code cause an error.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] arm-none-eabi-g++ compile the following code cause an error.



On 8/26/2010 4:06 AM, han hui wrote:

typedef void  VOID;
VOID  foo2 (VOID)
{
}


I believe this is invalid C++. The typedef is not a macro, therefore you have just declared a new type VOID which is equivalent to void. However, the new type VOID can't be used to declare a void function, only void can be used for that.

Either remove VOID from the function arguments e.g. foo2(), or use void e.g. foo2(void).

Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@xxxxxxxxxxxxxxxx
(650) 331-3385 x716