[Issue 11749] New: switch case fallthrough error is enabled with -w, but cannot be made informational warning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 15 06:10:16 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11749

           Summary: switch case fallthrough error is enabled with -w, but
                    cannot be made informational warning
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-12-15 06:10:13 PST ---
This code from issue 9642 (slightly modified to also trigger the message with
dmd 2.064):

void main() {
    int x;
    switch ('x') {
        case 'a':
            x++;
        case 'b':
            x++;
            break;
        default:
    }
}

compiles without additional options, but reports error (not warning) with -w
and -wi.

>dmd fail9642.d && echo Success
Success

>dmd -w fail9642.d && echo Success
fail9642.d(6): Error: switch case fallthrough - use 'goto case;' if intended

>dmd -wi fail9642.d && echo Success
fail9642.d(6): Error: switch case fallthrough - use 'goto case;' if intended

Even with -wi compilation fails.

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


More information about the Digitalmars-d-bugs mailing list