This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++/libstdc++: new "statement with no effect" warnings
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 04 Jan 2002 16:22:15 +0100
- Subject: Re: C++/libstdc++: new "statement with no effect" warnings
- References: <Pine.BSF.4.43.0201041605450.73469-100000@naos.dbai.tuwien.ac.at>
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?
>
A few pointers:
http://gcc.gnu.org/ml/gcc-bugs/2002-01/msg00119.html
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00251.html
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00041.html
Cheers,
Paolo.
>
>
>Gerald
>
--
Paolo Carlini
Dipartimento di Scienze Ambientali
Università degli Studi della Tuscia
Largo dell'Università, I-01100, Viterbo, ITALY