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

Timon Gehr via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 17 12:58:39 PDT 2015


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

Remove the return statement from main and the warning will go away.
(Note: unless you want to influence the return code, you can actually 
declare main as returning void, then you don't need it even if the end 
of the function is reachable.)


More information about the Digitalmars-d-learn mailing list