www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6449] New: Unused label warning


           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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc

--- Comment #0 from bearophile_hugs 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;
    if (x) goto 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

...>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: -------
Aug 07 2011