Bug 202183

Summary: When compiling supplied code fragment, a warning message is missed - should warn "statement with no effect"
Product: Red Hat Enterprise Linux 4 Reporter: Fritz Boehm <fritz>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-11 13:47:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Short c++ program none

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.