Get rid of annoying warnings -
Stevee - 16.06.2012
Hi, in my script I'm using SetTimer, to call a function, this is the only time I use the function, and pawno doesn't recognise the function as being used, therefore I get annoying warnings such as
Код:
warning 203: symbol is never used: "FinalStageGarbageFinish"
I was wondering, is there anyway to trick pawno into thinking I'm using it? The warnings are damn right annoying!
Re: Get rid of annoying warnings -
WillyP - 16.06.2012
Probably because it isn't being used.

You've maybe set something and forgot to assign something to that name?
Re: Get rid of annoying warnings -
Yuryfury - 16.06.2012
It doesn't matter whether or not it is called only by the timer.
A timer calls a callback. FinalStageGarbageFinish appears to be a simple variable that is assigned a value then never used.
Re: Get rid of annoying warnings -
iggy1 - 16.06.2012
You should really delete the variable if it's not going to be used. If it is going to be used further down the line and you want to hide the warning use this.
pawn Код:
#pragma unused FinalStageGarbageFinish
EDIT: Didn't realise it was a func you was talking about, make it a stock function. (you can also make variables stock)
Re: Get rid of annoying warnings -
Stevee - 16.06.2012
Okay, the timer was my fault, but I also get this:
Код:
warning 204: symbol is assigned a value that is never used: "RouteText"
But, I do use it, see here:
(snippets taken from script)
pawn Код:
new RouteText[255]; // declaring the variable
format(RouteText, sizeof(RouteText), TXT_GarbagePickupsLeft, TotalToPickup); // assigning a value
TextDrawSetString(APlayerData[playerid][MissionText], RouteText); // using the variable
Anyone got an idea why its doing that? Have I done something wrong? (The script still works)
Re: Get rid of annoying warnings -
tiernantheman - 16.06.2012
Quote:
Originally Posted by Stevee
Okay, the timer was my fault, but I also get this:
Код:
warning 204: symbol is assigned a value that is never used: "RouteText"
But, I do use it, see here:
(snippets taken from script)
pawn Код:
new RouteText[255]; // declaring the variable format(RouteText, sizeof(RouteText), TXT_GarbagePickupsLeft, TotalToPickup); // assigning a value TextDrawSetString(APlayerData[playerid][MissionText], RouteText); // using the variable
Anyone got an idea why its doing that? Have I done something wrong? (The script still works)
|
Try this or go less on the [128]
pawn Код:
new RouteText[128]; // declaring the variable
format(RouteText, sizeof(RouteText), TXT_GarbagePickupsLeft, TotalToPickup); // assigning a value
TextDrawSetString(APlayerData[playerid][MissionText], RouteText); // using the variable
Re: Get rid of annoying warnings -
Stevee - 16.06.2012
Nope, I even went down to the exact amount of characters there were in that message, had no effect on the warning
Re: Get rid of annoying warnings -
tiernantheman - 16.06.2012
Quote:
Originally Posted by Stevee
Nope, I even went down to the exact amount of characters there were in that message, had no effect on the warning 
|
Basically what it means is your not using the RouteText. Even know you have it on the lines you showed they don't count as using it. You need to include it with a command or a dialog or anything else. So try including it with a command or a dialog of some type.
Re: Get rid of annoying warnings -
iggy1 - 16.06.2012
Quote:
Originally Posted by tiernantheman
Basically what it means is your not using the RouteText. Even know you have it on the lines you showed they don't count as using it. You need to include it with a command or a dialog or anything else. So try including it with a command or a dialog of some type.
|
It does count as using it if you use it in a function, which he has done. I'm confused because you shouldn't get the warning with the code that was posted.
This doesn't cause a warning.
pawn Код:
public OnPlayerSpawn(playerid)
{
new used[6] = "hello";
TextDrawSetString(Text:1, used);
return 1;
}
Re: Get rid of annoying warnings -
Stevee - 16.06.2012
Really sorry for wasting your time, turns out I was looking at the wrong lines; note to self - read the warning properly.
Thankfully, all warnings have now been resolved!
I appreciate the help