This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
No warning for no-op / no-ops / noop / noops / statements without effect?
- From: Jeff Donner <jeffrey dot donner at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 29 Dec 2010 23:14:54 -0800
- Subject: No warning for no-op / no-ops / noop / noops / statements without effect?
Hi;
How do you get no-ops to trigger a warning? Eg this:
void noop()
{
int i = 6;
i |= 0;
int j = 5;
j += 0;
int k = 3;
k = k;
}
> g++ -pedantic -Wall -Wextra -O3 -c noops.cpp
>
compiles without complaint. Am I just missing a flag? (4.1.x, 4.4.x, 4.6)
Thanks.