[Bug 81] New: incorrect statement is not reachable in 0.18

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 2 19:56:33 PDT 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=81

           Summary: incorrect statement is not reachable in 0.18
           Product: GDC
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: glue layer
        AssignedTo: braddr at puremagic.com
        ReportedBy: lane at downstairspeople.org


This is from the version hosted at http://www.puremagic.com/~braddr/d/gdc/

======= example.d =======

module example;

import std.c.stdio, std.string;

void foo() {
  printf( toStringz( "foo!" ) );
}

void bar() {
  printf( toStringz( "bar!" ) );
}

void main( char[][] args ) {
  switch( args[1] ) {
    debug {
      case "--foo":
      case "-f":
        foo();
        break;
    }
    version( bar ) {
      case "--bar":
      case "-b":
        bar();
        break;
    }
    default:
      foo();
      bar();
      break;
  }
}

======== ========

lane at wookies:~$ gdc --version
gdc (GCC) 4.0.3 (gdc 0.18-alpha-1, using dmd 0.148)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

lane at wookies:~$ gdc -fdebug -fversion=bar -Wall example.d
warning - example.d:21: statement is not reachable


-- 




More information about the D.gnu mailing list