Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 202183 - When compiling supplied code fragment, a warning message is missed - should warn "statement with no effect"
When compiling supplied code fragment, a warning message is missed - should w...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-08-11 09:14 EDT by Fritz Boehm
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-11 09:47:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Short c++ program (289 bytes, text/plain)
2006-08-11 09:14 EDT, Fritz Boehm
no flags Details

  None (edit)
Description Fritz Boehm 2006-08-11 09:14:16 EDT
Description of problem:
When compiling with -Wall, a statement with no effect is not flagged by the

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:
Comment 1 Fritz Boehm 2006-08-11 09:14:20 EDT
Created attachment 134017 [details]
Short c++ program
Comment 2 Jakub Jelinek 2006-08-11 09:47:00 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.