Jump to content

Saying no to Warnings


ligenza
 Share

Recommended Posts

C:\1\1.au3(285,22) : WARNING: $littleninja: declared global in function only. Prefer top of file.

C:\1\1.au3(967,72) : WARNING: $love: possibly used before declaration.

I have a ton of warnings each time I go to compile my script. I'd love to know how I can simply turn them off as they do me no good. I understand what I'm doing in the code and I do not need a computer to warn me about design choices as I'm fully aware. ;)

Link to comment
Share on other sites

  • Developers

C:\1\1.au3(285,22) : WARNING: $littleninja: declared global in function only. Prefer top of file.

C:\1\1.au3(967,72) : WARNING: $love: possibly used before declaration.

I have a ton of warnings each time I go to compile my script. I'd love to know how I can simply turn them off as they do me no good. I understand what I'm doing in the code and I do not need a computer to warn me about design choices as I'm fully aware. ;)

I assume you use the SciTE4AutoIt3 installation when you get these warnings?

By default AU3Check is ran for both F5 & F7 to avoid possible syntax erros but if you want to skip AU3Check for a particular script you can add a Compiler directive that will tell CompileAU3 not to run the AU3check:

#Compiler_Run_AU3Check=n

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I assume you use the SciTE4AutoIt3 installation when you get these warnings?

By default AU3Check is ran for both F5 & F7 to avoid possible syntax erros but if you want to skip AU3Check for a particular script you can add a Compiler directive that will tell CompileAU3 not to run the AU3check:

#Compiler_Run_AU3Check=n

Rather then turn the entire check off is it possible to pick and choose which warnings to not display? I find the feature rather handy and I'd hate to loose it over a verbal disagreement.
Link to comment
Share on other sites

  • Developers

Rather then turn the entire check off is it possible to pick and choose which warnings to not display? I find the feature rather handy and I'd hate to loose it over a verbal disagreement.

All output from AU3Check is shown in the Output pane, but one thing that might be a useful option is to skip the POPUP msgbox showing the Errors/Warnings if there are no Errors returned from AU3Check.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

All output from AU3Check is shown in the Output pane, but one thing that might be a useful option is to skip the POPUP msgbox showing the Errors/Warnings if there are no Errors returned from AU3Check.

Is there a way for me to comment out the different warnings I don't want to see by editing AU3Check somehow? This would really save me a lot of grief. Thanks.
Link to comment
Share on other sites

  • Developers

Is there a way for me to comment out the different warnings I don't want to see by editing AU3Check somehow? This would really save me a lot of grief. Thanks.

This is not a standard feature in AU3check to my knowledge.

You could take CompileAU3.au3 and modify the portion that runs the AU3check program to filter out all warning lines returned from AU3Check before its dumped into the SciTE output pane.

I have no intent to build this in my version of CompileAU3 at this moment because i don't believe many people find use in this.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This is not a standard feature in AU3check to my knowledge.

You could take CompileAU3.au3 and modify the portion that runs the AU3check program to filter out all warning lines returned from AU3Check before its dumped into the SciTE output pane.

I have no intent to build this in my version of CompileAU3 at this moment because i don't believe many people find use in this.

I belive many people would find the option to customize AU3check usefull. I know in other IDEs options are provided to personalise the program to suit ones needs. This is merly my opinion. I thank you for the advice, I should be able to whip something up!
Link to comment
Share on other sites

  • Developers

I belive many people would find the option to customize AU3check usefull. I know in other IDEs options are provided to personalise the program to suit ones needs. This is merly my opinion. I thank you for the advice, I should be able to whip something up!

If thats true and you "whip" it up in a way that it can be merged into my version without breaking things i would be happy to do that.

It would need to be configurable via the Options menu and a new Compiler Directive....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I have a ton of warnings each time I go to compile my script. I'd love to know how I can simply turn them off as they do me no good. I understand what I'm doing in the code and I do not need a computer to warn me about design choices as I'm fully aware. ;)

In 1 month's time, will you be able to make that same statement? What about 2 months? How about 6?

Most of the warnings in Au3Check are just warning of non-typical ways of writing code. If you have to revisit code later, will you still remember that you've declared a Global variable in a function? Will you remember what function it was declared in so you don't accidentally call a function using the variable before it is initialized? Can you keep all this in your head forever and multiplied by the number of scripts you have active at any one time?

The easiest thing to do is to just fix the warnings. That means you don't have to waste a bunch of time writing some output filter and you make future maintenance infinitely easier when you don't have to worry about questionable coding tactics.

My response to other IDE's allowing warning customization would be this: It's a crutch people abuse. With C++, I generally try to fix the warning (Mostly type casts or size issues requiring more specific casts). I've found that fixing the code leads to much clearer code than making the warning go away. I'm of the mentality that warnings should be treated as errors and no warnings should be disabled. Writing clear code that will run/compile cleanly is important for maintainability.

To each his own, I suppose, but to me it doesn't make sense to spend a couple hours making a script to save a few minutes worth of work now that might yield you hours of time saved in the future if you revisit a script after you've forgotten the logic involved. I don't see where hiding the warning is going to gain anything and I do see lots of potential for harm in the form of wasted time.

Link to comment
Share on other sites

If thats true and you "whip" it up in a way that it can be merged into my version without breaking things i would be happy to do that.

It would need to be configurable via the Options menu and a new Compiler Directive....

If I'm able to create something more than a glorified hack I'll be happy to share it with everyone.

To each his own, I suppose

That's pretty much it. I can handle the responcibility hence my desire for options. However I totally see where you're coming from in terms of just fixing the code. For what I'm doing though I'd rather not as it's fine the way it is now or even ten years from now. Like you said to each his own, except right now we don't even have the option to each have our own prefrence as there's no options to toggle and I'm expressing my desire to change that. As much as I'd like to write a large reply the effort is simply too great for me. ;) I hope I articulated my thoughts clearly. Edited by ligenza
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...