Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mikusch opened this issue Jun 5, 2024 · 2 comments

Comments

@Mikusch
Copy link

Mikusch commented Jun 5, 2024

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()
---------------------^
@dvander
Copy link
Member

dvander commented Jun 6, 2024

In an include, this should not be an error.

@Mikusch
Copy link
Author

Mikusch commented Jun 6, 2024

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() {}

c0rp3n added a commit to c0rp3n/sourcepawn that referenced this issue Jun 9, 2024
This adds stock functions to the maybe used set which seems most appropriate.

We can then mark all of the functions they refer too as maybe used also.
dvander pushed a commit that referenced this issue Nov 11, 2024
This adds stock functions to the maybe used set which seems most appropriate.

We can then mark all of the functions they refer too as maybe used also.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants