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 deprecated raises warnings on usage within unused stock functions #865

Open
nosoop opened this issue Dec 19, 2022 · 3 comments
Open
Labels
compiler Problems with the compiler parsing source code. error reporting Issues that concern the error and warning messages emitted.

Comments

@nosoop
Copy link

nosoop commented Dec 19, 2022

#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    // nothing here...
}

#pragma deprecated This function is deprecated.
stock void UnusedFunction()
{
    NestedUnusedFunction();
}

#pragma deprecated This nested function is also deprecated.
stock void NestedUnusedFunction()
{
    
}
scripting\test_sourcepawn_deprecated_stock.sp(14) : warning 234: symbol "NestedUnusedFunction" is marked as deprecated: This nested function is also deprecated.

1 Warning.

Reproduced on the following SourceMod revisions:

  • 1.11.0.6911
  • 1.12.0.6949
@peace-maker peace-maker added bug error reporting Issues that concern the error and warning messages emitted. compiler Problems with the compiler parsing source code. labels Dec 19, 2022
@dvander
Copy link
Member

dvander commented Feb 24, 2023

This is intentional. Even if a stock is unused, it goes through full error reporting in 1.11+.

@dvander dvander closed this as completed Feb 24, 2023
@asherkin
Copy link
Member

This seems like something that would be nice to suppress - perhaps only when the stock itself is marked as deprecated? Otherwise there is no warning-free migration path for libraries.

@asherkin
Copy link
Member

asherkin commented Mar 1, 2023

Reopening this as (briefly) discussed on Discord - a PR would be much appreciated for this one and it sounds like it'll be quite a while otherwise.

@asherkin asherkin reopened this Mar 1, 2023
@asherkin asherkin removed the bug label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Problems with the compiler parsing source code. error reporting Issues that concern the error and warning messages emitted.
Projects
None yet
Development

No branches or pull requests

4 participants