public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14889] New: Bad detection of unreachable code with option -O -Wunreachable-code
@ 2004-04-08 12:53 jmarronn at rockwellcollins dot com
2004-04-08 13:00 ` [Bug c++/14889] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: jmarronn at rockwellcollins dot com @ 2004-04-08 12:53 UTC (permalink / raw)
To: gcc-bugs
On cygwin (CYGWIN_NT-5.0) on plateform W2K (5.00.2195) and g++ (gcc version
3.3.1 (cygming special), I have a probleme with option -Wunreachable-code and -
O.
G++ signal unreach code, which is totaly "reachable"...
Compilation sample:
$ g++ -O -Wunreachable-code essai.cpp -o essai
essai.cpp: In function `int main()':
essai.cpp:17: warning: will never be executed
Run result:
$ ./essai
true
false
Source of essai.cpp
#include <iostream>
class Condition
{
public:
void EssaiCond( const int );
};
void Condition::EssaiCond( const int cond )
{
if(cond)
{
std::cout << "true\n";
}
else
{
std::cout << "false\n";
}
}
int main()
{
Condition essai;
essai.EssaiCond(true);
essai.EssaiCond(false);
return(0);
}
--
Summary: Bad detection of unreachable code with option -O -
Wunreachable-code
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jmarronn at rockwellcollins dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14889
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/14889] Bad detection of unreachable code with option -O -Wunreachable-code
2004-04-08 12:53 [Bug c++/14889] New: Bad detection of unreachable code with option -O -Wunreachable-code jmarronn at rockwellcollins dot com
@ 2004-04-08 13:00 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-08 13:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-08 13:00 -------
This is a dup of bug 12668.
*** This bug has been marked as a duplicate of 12668 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14889
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-08 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-08 12:53 [Bug c++/14889] New: Bad detection of unreachable code with option -O -Wunreachable-code jmarronn at rockwellcollins dot com
2004-04-08 13:00 ` [Bug c++/14889] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).