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.
- To: han hui <sylixos@xxxxxxxxx>
- Subject: Re: [arm-gnu] arm-none-eabi-g++ compile the following code cause an error.
- From: Carlos O'Donell <carlos@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Aug 2010 10:53:51 -0400
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