Stock Warning
#1

Hi, i wrote a function for making a calculation but it keeps giving warnings. I tried to fix warning but in that case it gives another warning. Those warnings doesn't affecting something but it's the only warning at my script and this is annoying me.

Code Option #1
Warning: warning 225: unreachable code (pointing "return -1;")
Код:
stock stockname(some params)
{
	//my code here
	for(;;i++)
	{
	   //more code
	    if(...)
		    return i;
	}
	return -1;
}
Code Option #2
Warning: function "stockname" should return a value
Код:
stock stockname(some params)
{
	//my code here
	for(;;i++)
	{
	   //more code
	    if(...)
		    return i;
	}
}
How can i get rid of that warning?
Reply


Messages In This Thread
Stock Warning - by Ilhan - 18.02.2016, 14:17
Re: Stock Warning - by zPain - 18.02.2016, 14:28
Re: Stock Warning - by Ilhan - 18.02.2016, 14:39
Re: Stock Warning - by Gammix - 18.02.2016, 14:43
Re: Stock Warning - by Ilhan - 18.02.2016, 14:51
Re: Stock Warning - by Nero_3D - 18.02.2016, 16:32
Re: Stock Warning - by Ilhan - 18.02.2016, 17:45

Forum Jump:


Users browsing this thread: 1 Guest(s)