AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   warning suppression in SM 1.11 (https://forums.alliedmods.net/showthread.php?t=338520)

OneMore 07-10-2022 08:15

warning suppression in SM 1.11
 
Recently because of the issue with cs:go, I replaced Sourcemod from 1.10 to 1.11.
I suppressed unnecessary warning 217 (inconsistent indentation) in SM 1.10 by adding a parameter -w217 to ./compile.sh script.
However, it does not work in SM 1.11, it looks like syntaxis was changed. But both variants ( -w217 or --warning=217 ) do not work and I'm getting this warning.
I have SM 1.11 v 6863 which is the latest compiled for macOS.

The worst thing is that it catches this warning in includes files and with several includes files I even can't find where is it. :( I mean the .sp file length is 600 lines, but it gives warnings for lines 1200 and 1700

So guys, what is the way now how to suppress this warning. And if you can advise how to find where it warns for complicated projects with several includes and dozens of files, I will much appreciate it.

PC Gamer 07-10-2022 14:27

Re: warning suppression in SM 1.11
 
The warning is telling you that the code has mixed formatting, such as some lines having spaces for space and others having tab for space. You can fix each line individual or use an automated tool to reformat it for you.

I use Notepad++ with the TextFX plugin installed. That allows me to click a button to have it reformat the code for me. It works very well.

Explanation of the process: https://qnaplus.com/how-to-re-indent...using-notepad/

Link to Notepad++: https://notepad-plus-plus.org/

I hope this helps...

OneMore 07-11-2022 09:19

Re: warning suppression in SM 1.11
 
Quote:

Originally Posted by PC Gamer (Post 2783472)
...I hope this helps...

It was not help at all I'm afraid :) It looks like you just read a subject. But I described the issue in the text of the post.

By the way, can someone describe why this "formatting" issue is so important that we have the special warning for it?

Marttt 07-11-2022 10:55

Re: warning suppression in SM 1.11
 
Is just a "warning" if it was that special would be an "error"

Just make the file standard only with spaces or only with tabs,
As PC Gamer said you can see it better in a proper text editor (like Notepad++, View>Symbols>All Characteres)

OneMore 07-12-2022 06:16

Re: warning suppression in SM 1.11
 
Quote:

Originally Posted by Marttt (Post 2783539)
Is just a "warning" if it was that special would be an "error"

Just make the file standard only with spaces or only with tabs,
As PC Gamer said you can see it better in a proper text editor (like Notepad++, View>Symbols>All Characteres)

Guys, sorry, but do you read my message?
I wrote
Quote:

The worst thing is that it catches this warning in includes files and with several includes files I even can't find where is it. I mean the .sp file length is 600 lines, but it gives warnings for lines 1200 and 1700
I understand that I can just edit the file. But I do not know which file I have to edit. If you can help me how to find which file should I edit...
And I'm sure that much easier to suppress this warning, because it is so useless and never influences the result.

Marttt 07-12-2022 08:28

Re: warning suppression in SM 1.11
 
You didn't paste the warning console output.

Usually, the file and line is mentioned in the warning.

e.g: plugin.sp(100) : warning 217: inconsistent indentation (did you mix tabs and spaces?)

means that at line 100 a mix was found.

You said that the warning was for lines 1200 and 1700, so maybe you just need fix 2 lines which is easier than trying to fix it with a supress warning.
If the plugin is 600 length, probably the issue is in the include files (that's why is hard to help without the console output), more likely you having this message for a ".inc" file.

If you really want to suppress the warning maybe open an issue at sourcemod github or try help in the AM discord channel.

OneMore 07-13-2022 03:41

Re: warning suppression in SM 1.11
 
Quote:

Originally Posted by Marttt (Post 2783611)
You didn't paste the warning console output...

I did not paste it because it does not help :(

Anyway here it is:
Quote:

Compiling gungame.sp...
SourcePawn Compiler 1.11.0.6863
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2021 AlliedModders LLC

gungame.sp(1223) : warning 217: inconsistent indentation (did you mix tabs and spaces?)
gungame.sp(1728) : warning 217: inconsistent indentation (did you mix tabs and spaces?)
Code size: 145284 bytes
Data size: 40412 bytes
Stack/heap size: 33292 bytes
Total requirements: 218988 bytes
As I mentioned, gungame.sp is 600 lines long. But it is the complicated plugin with a lot of includes:
Quote:

#include <sourcemod>
#include <sdktools>
#include <cstrike>

#include <colors>
#include <gungame_const>
#include <gungame>
#include <gungame_config>
#include <langutils>

#if defined WITH_SDKHOOKS
#include <sdkhooks>
#endif

#undef REQUIRE_PLUGIN
#include <gungame_stats>

#include "gungame/gungame.h"
#include "gungame/menu.h"
#include "gungame/config.h"
#include "gungame/keyvalue.h"
#include "gungame/event.h"
#include "gungame/offset.h"
#include "gungame/util.h"

#if defined GUNGAME_DEBUG
#include "gungame/debug.h"
#include "gungame/debug.sp"
#endif

#include "gungame/stock.sp"
#include "gungame/util.sp"
#include "gungame/natives.sp"
#include "gungame/offset.sp"
#include "gungame/config.sp"
#include "gungame/keyvalue.sp"
#include "gungame/event.sp"
#include "gungame/menu.sp"
#include "gungame/commands.sp"
Thanks for the advice to request help in the github regarding suppression. I'll try to do it.

Peace-Maker 07-13-2022 05:46

Re: warning suppression in SM 1.11
 
There was a bug with reported lines for error reporting that was fixed a while ago. You can find a newer compiler for macOS in this standalone bundle containing only the scripting environment. Try updating your compiler and check the error messages again. If it's still off please open an issue in the sourcepawn repo.

https://github.com/alliedmodders/sou...uns/2629456551 (needs Github login)
https://nightly.link/alliedmodders/s...ripting/master (no login)

OneMore 07-13-2022 15:09

Re: warning suppression in SM 1.11
 
Quote:

Originally Posted by Peace-Maker (Post 2783661)
You can find a newer compiler for macOS in this standalone bundle containing only the scripting environment.

Thanks!

I found version 1.11. It does not suppress warning by -w217 or --warning=217. However, it reflects the correct file at least.
Quote:

gungame/util.sp(1223) : warning 217: inconsistent indentation (did you mix tabs and spaces?)
Thanks a lot.


All times are GMT -4. The time now is 08:38.

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