C++/libstdc++: new "statement with no effect" warnings
Jakub Jelinek
jakub@redhat.com
Fri Jan 4 07:23:00 GMT 2002
On Fri, Jan 04, 2002 at 04:08:04PM +0100, Gerald Pfeifer wrote:
> Today (or very recently) I started getting a warning
> x.cc:10: warning: statement with no effect
> for the following code when compiling with -Wall:
>
> 1 #include <vector>
> 2
> 3 using namespace std;
> 4
> 5 typedef unsigned U;
> 6 typedef vector<unsigned> V;
> 7
> 8 int main() {
> 9 U *u = new U[43];
> 10 V *v = new V[43]; // warning: statement with no effect
> 11
> 12 delete[] u;
> 13 delete[] v;
> 14 }
>
> What's the problem here?
See http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00251.html
Jakub
More information about the Gcc
mailing list