www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 0.116 warning: statement is not reachable

reply Vathix <vathix dprogramming.com> writes:
void foo(int num)
{
    if(num == 2)
       return;
    printf("foo!\n"); // Line 5.
}

int main()
{
    foo(1);
    return 0;
}


dmd -w -c test
warning - test.d(5): statement is not reachable


It also won't output an obj file if there's a warning.

- Chris
Mar 07 2005
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
 It also won't output an obj file if there's a warning.

Definitely not upgrading until 0.117 then.
Mar 08 2005
parent Vathix <vathix dprogramming.com> writes:
On Tue, 8 Mar 2005 16:14:25 -0500, Jarrett Billingsley <kb3ctd2 yahoo.com>  
wrote:

 It also won't output an obj file if there's a warning.

Definitely not upgrading until 0.117 then.

Since warnings have to be manually enabled with -w it's not such a big deal.
Mar 08 2005
prev sibling parent Ivan Cibiri <Ivan_member pathlink.com> writes:
It seems to be a warning bug also in this situation:

int main() { // Line 1
int i = 1;

if(i == 1) {
throw new Error("err 1");
}
i += 5; //Line 6
return 0;
}

dmd -w test.d
warning - test.d(6): statement is not reachable

Ivan.

In article <opsnapvzo5kcck4r esi>, Vathix says...
void foo(int num)
{
    if(num == 2)
       return;
    printf("foo!\n"); // Line 5.
}

int main()
{
    foo(1);
    return 0;
}


dmd -w -c test
warning - test.d(5): statement is not reachable


It also won't output an obj file if there's a warning.

- Chris

Mar 08 2005