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

#pragma unused can't be used on functions #1021

Open
b0mbie opened this issue Jan 12, 2025 · 0 comments
Open

#pragma unused can't be used on functions #1021

b0mbie opened this issue Jan 12, 2025 · 0 comments

Comments

@b0mbie
Copy link

b0mbie commented Jan 12, 2025

#pragma unused g_SomeStatic
any g_SomeStatic;

void SomeFunction() {
	any someLocal;
	#pragma unused someLocal
}

// This will report `error 017: undefined symbol "SomeFunction"`.
#pragma unused SomeFunction

... yields:

pragma-unused.sp(10) : error 017: undefined symbol "SomeFunction"
    10 | #pragma unused SomeFunction
-----------------^

This became a problem when trying to compile TF2Attributes. The code compiled on 1.11.0.6970, but didn't on 1.12.0.7177 and 1.13.0.7190 (latest versions for each major release). Considering what #pragma unused is used for, it didn't seem to be intentional behavior.

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

1 participant