gcc-3.4.2 failed to compile some codes.

Lei Sun lei_sun at comcast.net
Sat Jan 7 01:32:59 UTC 2006


Actually, it should be
m_msg = new MsgClass *[size];     (without (), on MsgClass)
The original program intended to allcate an array of MsgClass pointer. The 
old compiler accept (), but the new doesn't

lei sun

>The piece of code that failed looks like this
>
>myclass::myclass(int size)
>{
>   m_msg = new (MsgClass *)[size];
>...
>}
----- Original Message ----- 
From: "Mike Frysinger" <vapier at gentoo.org>
To: "Lei Sun" <lei_sun at comcast.net>
Cc: <uclibc at uclibc.org>
Sent: Friday, January 06, 2006 8:28 PM
Subject: Re: gcc-3.4.2 failed to compile some codes.


> On Friday 06 January 2006 20:19, Lei Sun wrote:
>> The code is not wrong
>
> yes it is, you should not be using []
>
> just because older compilers accepted it doesnt make it correct
> -mike 




More information about the uClibc mailing list