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

disable specific compile warning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 05-28-2022 , 12:07   disable specific compile warning
Reply With Quote #1

updated SourcePawn 1.10 to 1.11, everything was fine except the compile warning

Code:
warning 242: function "Native_SendSQLUpdate" should return an explicit value
warning 242: function "RankConnect" should return an explicit value
warning 242: function "event_DefibPlayer" should return an explicit value
warning 209: function has explicit 'int' tag but does not return a value
...
546 Warnings.
these functions no need return any value at all. how to disable these warning?

Last edited by ProjectSky; 05-28-2022 at 12:09.
ProjectSky is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-28-2022 , 20:29   Re: disable specific compile warning
Reply With Quote #2

When I receive that 242 warning I usually add this to the end of the function:
PHP Code:
return Plugin_Handled
The 209 warning is looking for number value since you used 'int' as the type of function. In that case I would return the variable value if it exists. If not then I would use this:
PHP Code:
return 0
Keep in mind that I'm not a professional programmer. I'm merely a hobbyist.
PC Gamer is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 05-28-2022 , 21:22   Re: disable specific compile warning
Reply With Quote #3

If your functions don't return anything you should use void as return type.
xerox8521 is offline
Reply



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 19:17.


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