public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/25184]  New: another wrong "will never be executed" warning with switch - case
@ 2005-11-30 16:12 oliverst at online dot de
  2005-11-30 16:20 ` [Bug middle-end/25184] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2006-03-01  5:02 ` gdr at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: oliverst at online dot de @ 2005-11-30 16:12 UTC (permalink / raw)
  To: gcc-bugs

With the attached code I get

C:\Dev-Cpp\Projects\test-stlport\main_19.cpp In function `void test_19(long
unsigned int)': 
8 C:\Dev-Cpp\Projects\test-stlport\main_19.cpp [Warning] will never be executed 
8 C:\Dev-Cpp\Projects\test-stlport\main_19.cpp [Warning] will never be executed

and when I uncomment the "i = 1" I get

C:\Dev-Cpp\Projects\test-stlport\main_19.cpp In function `void test_19(long
unsigned int)': 
10 C:\Dev-Cpp\Projects\test-stlport\main_19.cpp [Warning] will never be
executed 

void test_19(unsigned long ul_reason_for_call)
{ 
        int i = 0;
        switch (ul_reason_for_call)
        {
                case 1:                  
                        //i = 1;
                        break;
                case 2:
                        break;
                case 3:
                        break;
                case 4:
                        break;
    }
}

Happend when compiled C and C++.

C:\MinGW_3.4.4\bin>gcc -v
Reading specs from ../lib/gcc/mingw32/3.4.4/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls
--enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared
--e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x
--enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.4 (mingw special)


-- 
           Summary: another wrong "will never be executed" warning with
                    switch - case
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oliverst at online dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25184


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/25184] [3.4 Regression] another wrong "will never be executed" warning with switch - case
  2005-11-30 16:12 [Bug middle-end/25184] New: another wrong "will never be executed" warning with switch - case oliverst at online dot de
@ 2005-11-30 16:20 ` pinskia at gcc dot gnu dot org
  2006-03-01  5:02 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-30 16:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-30 16:20 -------
Confirmed, only a 3.4 regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|                            |3.4.0 3.3.3 3.2.3
      Known to work|                            |3.0.4 4.0.0 4.1.0 4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-30 16:20:41
               date|                            |
            Summary|another wrong "will never be|[3.4 Regression] another
                   |executed" warning with      |wrong "will never be
                   |switch - case               |executed" warning with
                   |                            |switch - case
   Target Milestone|---                         |3.4.6


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25184


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/25184] [3.4 Regression] another wrong "will never be executed" warning with switch - case
  2005-11-30 16:12 [Bug middle-end/25184] New: another wrong "will never be executed" warning with switch - case oliverst at online dot de
  2005-11-30 16:20 ` [Bug middle-end/25184] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2006-03-01  5:02 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-03-01  5:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from gdr at gcc dot gnu dot org  2006-03-01 05:02 -------
Fixed in 4.0.0 and up.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|3.4.6                       |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25184


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-01  5:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-30 16:12 [Bug middle-end/25184] New: another wrong "will never be executed" warning with switch - case oliverst at online dot de
2005-11-30 16:20 ` [Bug middle-end/25184] [3.4 Regression] " pinskia at gcc dot gnu dot org
2006-03-01  5:02 ` gdr 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).