Raised This Month: $12 Target: $400
 3% 

Tag mismatch warning on custom formatting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AdRiAnIlloO
Member
Join Date: Jul 2015
Location: Spain
Old 02-17-2021 , 14:59   Tag mismatch warning on custom formatting
Reply With Quote #1

Hi,

I've noticed as soon as there's a string format specifier (%s) or translations one (%t) in custom formatting functions, the compiler produces the "213: tag mismatch" warning. Not only this, but in another code of mine which wraps Menu.Additem(), using these specifiers causes wrong formatting errors, and I think it's very serious.

Code:
public void OnPluginStart()
{
	FormatCustom("Warning: %s", "test");
}

void FormatCustom(const char[] format, ...)
{
  // ... VFormat() stuff
}
I'm using latest compiler. Why is this? Thanks

P.S. I tried to file this as a bug report in BugZilla but somehow I don't have access to the SourceMod category, other than AM Security -> SourceMod.

Last edited by AdRiAnIlloO; 02-17-2021 at 15:00.
AdRiAnIlloO is offline
AdRiAnIlloO
Member
Join Date: Jul 2015
Location: Spain
Old 02-17-2021 , 16:06   Re: Tag mismatch warning on custom formatting
Reply With Quote #2

Alright, never mind. The variadic parameters were being treated as integer. I hadn't read the VFormat part of the string formatting document where it says the "..." need to have the "any" keyword type. Sorry.

Last edited by AdRiAnIlloO; 02-17-2021 at 16:07.
AdRiAnIlloO is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-17-2021 , 17:44   Re: Tag mismatch warning on custom formatting
Reply With Quote #3

Quote:
Originally Posted by AdRiAnIlloO View Post
P.S. I tried to file this as a bug report in BugZilla but somehow I don't have access to the SourceMod category, other than AM Security -> SourceMod.
Trying to file this as a bug would have been wrong, but for future reference SM / SP bugs are tracked on GitHub.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode