sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

Static functions called by stock functions now report "symbol is never used" warnings

Open Mikusch opened this issue 1 year ago • 2 comments

Using the SourcePawn Compiler 1.12.0.7140, static functions will now report "symbol is never used" warnings if the stock they are referenced in is not used in the plugin. I'm not sure if this is the intended behavior now, but it doesn't make much sense in my opinion.

static void SomeHelperFunction()
{
	PrintToServer("I'm helping!");
}

stock void HelpMe()
{
	SomeHelperFunction();
}

Output:

spcomptest.sp(1) : warning 203: symbol is never used: "SomeHelperFunction"
     1 | static void SomeHelperFunction()
---------------------^

Mikusch avatar Jun 05 '24 16:06 Mikusch

In an include, this should not be an error.

dvander avatar Jun 06 '24 03:06 dvander

In an include, this should not be an error.

The warning does show up in includes.

test.inc

static void SomeHelperFunction()
{
	PrintToServer("I'm helping!");
}

stock void HelpMe()
{
	SomeHelperFunction();
}

test.sp

#include <test>

public void OnPluginStart() {}

Mikusch avatar Jun 06 '24 10:06 Mikusch