x


Disable warning messages

Greetings,

Is it possible to disable the yellow exclamation point warnings in the editor console? Many of my variables are not recognized as being used, they are used btw, and my Console is filling up with a ton of these warnings. I would prefer only the serious warnings appeared.

Thanks

more ▼

asked Jul 08 '10 at 02:08 PM

kilgore gravatar image

kilgore
399 6 10 20

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

In C# you can disable them via a pragma at the top of your script file (I don't think Javascript has anything but #pragma strict). Some common ones being:

#pragma warning disable 0168 // variable declared but not used.
#pragma warning disable 0219 // variable assigned but not used.
#pragma warning disable 0414 // private field assigned but not used.

As other warnings come up you just keep adding them - I strongly suggest you take them out for the final build. :) This is just for development.

more ▼

answered Jul 08 '10 at 02:16 PM

Cyclops gravatar image

Cyclops
7.1k 33 63 115

awesome, thanks cyclops. Just to clarify, you suggest deleting all of the pragmas before final build? Is this to make sure you really do not have unused variables and what not? Thanks.

Jul 08 '10 at 02:21 PM kilgore

@Andrew - correct. In fact, any time I am about to make a major check-in to Subversion (version control), I comment the lines out just to check for any problems.

Jul 08 '10 at 02:25 PM Cyclops

thank you soooo much it got pretty annoying now when I'm rewriting my code

Mar 31 at 08:02 AM sdgd
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1675
x107
x20

asked: Jul 08 '10 at 02:08 PM

Seen: 4301 times

Last Updated: Mar 31 at 08:02 AM