sourcepawn
sourcepawn copied to clipboard
`#pragma deprecated` raises warnings on usage within unused stock functions
#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
This is intentional. Even if a stock is unused, it goes through full error reporting in 1.11+.
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.
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.