[Issue 4176] Link error in switch with 4 or more cases and no default

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 12 12:43:14 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4176


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.031                       |0.145
            Summary|Link error when case range  |Link error in switch with 4
                   |covers 4 or more cases.     |or more cases and no
                   |                            |default


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-05-12 12:43:13 PDT ---
Actually it doesn't need case range. It happens even on prehistoric releases of
DMD (I tested DMD 0.140).

void bug4176(int x)
{
   switch(x)
   {    
   case 1:
   case 2:
   case 3:
   case 4:
        break;
   }   
}

If you compile with -w, you get a "no default" warning, so it doesn't reach the
linker.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list