Hi there,
is there a way to tell the compiler to ignore a warning once i have verified it?
Thank you
How to ignore warnings?
Re: How to ignore warnings?
Have you tried clearing the DisplayWarnings setting in eCompile.cfg?
Re: How to ignore warnings?
Sadly, that will just hide ALL warnings, that's not what I am looking for, i just want to exclude some specific warnings.
Re: How to ignore warnings?
What specific warnings would you like to ignore?
Giving one general example (bear with me, I haven't coded POL in years)
The above code will generate a compiler warning that variable 'entry' is declared but never used. But I absolutely must have the variable and I do use it. So I stick in an entry := entry; to stop the warning.
Giving one general example (bear with me, I haven't coded POL in years)
Code: Select all
foreach entry in SomeArrayOfStrings
SendSysMessage(who, SomeArrayOfStrings{_entry_iter]);
endforeachRe: How to ignore warnings?
I know that's the type of warnings I want to suppress. I've used the same technique CWO but it is cumbersome.CWO wrote:What specific warnings would you like to ignore?
Giving one general example (bear with me, I haven't coded POL in years)
The above code will generate a compiler warning that variable 'entry' is declared but never used. But I absolutely must have the variable and I do use it. So I stick in an entry := entry; to stop the warning.Code: Select all
foreach entry in SomeArrayOfStrings SendSysMessage(who, SomeArrayOfStrings{_entry_iter]); endforeach
You know, I never quite understood why that generates a "not used" warning because technically it is used as an iterator (is that the right word?) in the foreach statement.
Re: How to ignore warnings?
Yep, your "entry .= entry" example does exactly what i am looking for. It sadly has the drawback of generating code that will waste instruction cycles when excuted.
My goal is to put some sort of annotation in the code to say the compiler "i know this should trigger a warning, but i have already checked it and it's ok like this, please don't warn me".
Thank you!
My goal is to put some sort of annotation in the code to say the compiler "i know this should trigger a warning, but i have already checked it and it's ok like this, please don't warn me".
Thank you!
Re: How to ignore warnings?
I believe you can do it before the foreach so you only do it once and get rid of the warning. Again, haven't programmed POL in a long time so this might be me just overthinking...
var entry := 0;
entry := entry;
foreach entry ....
var entry := 0;
entry := entry;
foreach entry ....
Re: How to ignore warnings?
To follow up, I think time has come for me to give some contribution to the core.
I am not a C++ programmer, but I am used to learn fast, so I thought this easy mod was a good place where to start.
I have added a new "unused" keywork to the eScript language. It has no practical effect, but tell the compiler not to issue a warning if the given variable is not used. The compiler will instead issue a warning if the given variable is used.
Example:
Hope this will be useful to others who, like me, don't really like warnings
I will release the code as soon as I will complete testing.
I am not a C++ programmer, but I am used to learn fast, so I thought this easy mod was a good place where to start.
I have added a new "unused" keywork to the eScript language. It has no practical effect, but tell the compiler not to issue a warning if the given variable is not used. The compiler will instead issue a warning if the given variable is used.
Example:
Code: Select all
program onremovescript( character, container, unused item, unused item_amount, movetype )
<some code here...>
endprogram
function myfunc( parameter1, unused parameter_for_future_use )
<some code here...>
endfunction