Fix bogus CreateDialog deprecation warning on every compile - #2543
Open
synml wants to merge 1 commit into
Open
Conversation
The apostrophe in "Doesn't" makes the #pragma deprecated message swallow the next line, so IsSoundPrecached becomes an undefined symbol and the deprecation attaches to CreateDialog instead. Reword the message to avoid it.
synml
marked this pull request as ready for review
August 12, 2026 06:22
Contributor
|
I guess it is more of a compiler's mistake, so it has to be fixed from the compiler's side rather than applying a small adjustment to the include file and call it a fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since the
#pragma deprecatedwas added toIsSoundPrecached, every plugin compile emits this warning, even for an empty plugin that only does#include <sourcemod>:Note the warning names
CreateDialogbut printsIsSoundPrecached's deprecation message — andCreateDialogreturnsvoid, so "always returns true" cannot apply to it.Cause
The apostrophe in
Doesn'tis lexed as the start of a character literal, so the#pragma deprecatedmessage swallows the following line — the entirenative bool IsSoundPrecached(...)declaration (which is why it appears verbatim in the warning output). As a result:IsSoundPrecachedbecomes an undefined symbol (calling it fails witherror 017: undefined symbol "IsSoundPrecached").CreateDialog.DisplayAskConnectBoxin the same file callsCreateDialog, and stocks are analyzed even when unused, so the warning fires on every compile of every plugin.Minimal repro of the compiler behavior:
Fix
Reword the message to avoid the apostrophe (
Doesn't->Does not). Verified with spcomp 1.12.0.7246:IsSoundPrecachedresolves again, and actual call sites get the intended warning 234 onIsSoundPrecacheditself.The underlying lexer behavior is arguably a separate sourcepawn bug, but rewording the message fixes the fallout for every SourceMod user today.
Backport
Since the warning affects everyone compiling against 1.12 includes, a backport to
1.12-devwould be appreciated.