Description of problem: When compiling with -Wall, a statement with no effect is not flagged by the compiler. Version-Release number of selected component (if applicable): Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-49) How reproducible: Every time. Steps to Reproduce: 1.compile supplied program like this: g++ -Wall -c bug.cpp Actual results: The line (line 17 of bug.cpp): ((*a).second) == Value; does not generate a "statement with no effect" warning. Expected results: I would expect the warning, "statement with no effect" Additional info:
Created attachment 134017 [details] Short c++ program
This is fixed in GCC 4.0.x and 4.1.x, but is too risky to backport. in RHEL4 we include GCC 4.1.x as a preview compiler and in RHEL5 it will be the primary system compiler.