Possible minor g++ 3.4 issue

Dan Olson dan@linuxgamepublishing.com
Tue Feb 17 06:50:00 GMT 2004


Hi,

I'm not sure of the standard's position on the following code:

int main ()
{
   unsigned char *buffer = new (unsigned char)[1024];

   delete [] buffer;
}

3.3 versions of g++ accept this code without complaint, but 3.4 gives
the message:

test.cpp:3: error: expected `,' or `;' before '[' token

Changing the code to the more "normal"

unsigned char *buffer = new unsigned char[1024];

fixes the compilation error, but I'm wondering if 3.4 is correct in
rejecting this code.

Thank you

-- 
Dan Olson



More information about the Gcc-bugs mailing list