This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]