This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Possible new[] regression in 3.4 WRT 3.3.[12]
- From: David Daney <ddaney at avtrex dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 16 Feb 2004 13:34:43 -0800
- Subject: Possible new[] regression in 3.4 WRT 3.3.[12]
I have the following code that compiles without warnings with g++ 3.3.2
(x86-pc-linux) and 3.3.1 (mipsel-linux). But I get an error under 3.4.
Not being a C++ expert, can someone tell me if my code is bogus, or if
this is a problem with 3.4.
Here is the code:
----------d1.cpp--------8<------------------------
char **
f1()
{
char** pSections;
// allocate an array of 10 char pointers.
pSections = new (char*)[10];
return pSections;
}
---------------8<----------------------------
These are the errors:
[daney@dl junk]$ mipsel-linux-g++ --version
mipsel-linux-g++ (GCC) 3.4.0 20040214 (prerelease)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[daney@dl junk]$ mipsel-linux-g++ -c d1.cpp
d1.cpp: In function `char** f1()':
d1.cpp:7: error: expected `;' before '[' token
Thanks,
David Daney