Bug 202183 - When compiling supplied code fragment, a warning message is missed - should warn "statement with no effect"
Summary: When compiling supplied code fragment, a warning message is missed - should w...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.0
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-08-11 13:14 UTC by Fritz Boehm
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-11 13:47:00 UTC
Target Upstream Version:
Embargoed:


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

Description Fritz Boehm 2006-08-11 13:14:16 UTC
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:

Comment 1 Fritz Boehm 2006-08-11 13:14:20 UTC
Created attachment 134017 [details]
Short c++ program

Comment 2 Jakub Jelinek 2006-08-11 13:47:00 UTC
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.