bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
http://pastebin.com/fknwgjtz i tried to call fibers in a loop forever, to multiplex some networking client worker fibers and a listener fiber it seems to work correctly with for(int i=0;i<1;) with while(true) i get: C:\dev\server_client>dub Building server_client ~master configuration "appli

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
using DMD32 D Compiler v2.068.0 on windows x64

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:32:16 UTC, ddos wrote: source\app.d(72): Warning: statement is not reachable What's there? Anything after an endless loop is potentially unreachable and dub treats warnings as errors. With the for loop, the compiler can't be as sure that it is endless be

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Sep 17, 2015 at 07:32:13PM +, ddos via Digitalmars-d-learn wrote: > http://pastebin.com/fknwgjtz > > i tried to call fibers in a loop forever, to multiplex some networking > client worker fibers and a listener fiber > it seems to work correctly with for(int i=0;i<1;) > > with while(t

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:35:05 UTC, Adam D. Ruppe wrote: What's there? Anything after an endless loop is potentially unreachable and dub treats warnings as errors. i see, thx

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:43:02 UTC, H. S. Teoh wrote: On Thu, Sep 17, 2015 at 07:32:13PM +, ddos via Digitalmars-d-learn wrote: http://pastebin.com/fknwgjtz i tried to call fibers in a loop forever, to multiplex some networking client worker fibers and a listener fiber it seem

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Timon Gehr via Digitalmars-d-learn
On 09/17/2015 09:47 PM, ddos wrote: yeah i tried for(;;) and it generates the same warning :) sure, here is the full example, it's not too long anyways ( the example doesn't make much sense tho because socket.accept is blocking :P ) http://pastebin.com/9K0wRRD6 ps: pastebin needs D support :-D

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:47:15 UTC, ddos wrote: yeah i tried for(;;) and it generates the same warning :) sure, here is the full example, it's not too long anyways ( the example doesn't make much sense tho because socket.accept is blocking :P ) http://pastebin.com/9K0wRRD6 Yeah, i

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-18 Thread ddos via Digitalmars-d-learn
thank you :) works now

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-18 Thread Kagamin via Digitalmars-d-learn
This compiles with enabled warnings: --- int f() { while(true){} assert(false); } ---