[Issue 6449] New: Unused label warning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 7 05:40:57 PDT 2011


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

           Summary: Unused label warning
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-08-07 05:40:56 PDT ---
This is related to issue 3960 (that is about unused variable warnings).

This is a C program (it's valid D code too):


int main() {
    int x = 0;
    A:
    if (x) goto B;
    x++;
    B:
    return x;
}


With DMD 2.054 it gives no errors or warnings, but GCC 4.6.0 shows a warning
that I'd like in D too (it's less commonly useful than unused variable
warnings):

...>gcc -Wall test.c -o test
test.c: In function 'main':
test.c:3:5: warning: label 'A' defined but not used [-Wunused-label]

-- 
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