Compiler Warnings...
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
very.
I'd rather be phishing!
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
My default project is edited to include "Treat warnings as errors: All" and "Warning level: 4", as well as ticking "XML documentation file" - which gives a error if I forget the XML header for a public item. If your code has warnings, there is probably something you haven't thought of ... particularly if you are a beginner.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
All warnings are on in VS2017, except for some obscure projects made by students, brrrrr X|
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
Visual Studio:
Quote:
warning CS0168: The variable '_ex' is declared but never used
Everybody else: The F! Me: ... So what, i need the Exception message!
if(!string.IsNullOrWhiteSpace(_signature))
{
MessageBox.Show("This is my signature: " + Environment.NewLine + _signature);
}
else
{
MessageBox.Show("404-Signature not found");
} -
All warnings are on in VS2017, except for some obscure projects made by students, brrrrr X|
*SOB* Hey! Our code works! * * Or at least something almost similar if you disable the warnings.
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
Like any normal person: Completely ignoring them! :doh:
Anything that is unrelated to elephants is irrelephant
Anonymous
-----
The problem with quotes on the internet is that you can never tell if they're genuine
Winston Churchill, 1944
-----
Never argue with a fool. Onlookers may not be able to tell the difference.
Mark Twain -
*SOB* Hey! Our code works! * * Or at least something almost similar if you disable the warnings.
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
Order, order :mad:
-
Visual Studio:
Quote:
warning CS0168: The variable '_ex' is declared but never used
Everybody else: The F! Me: ... So what, i need the Exception message!
if(!string.IsNullOrWhiteSpace(_signature))
{
MessageBox.Show("This is my signature: " + Environment.NewLine + _signature);
}
else
{
MessageBox.Show("404-Signature not found");
}I used to go through the code and clean those out but then I decided life was too short. When I did Delphi I would sometimes get a variable not initialized warning but when I initialized it I would get a value assigned but never used warning if the variable was in a try..except block.
-
Order, order :mad:
2 pints of lager, and a packet of crisps, please.[^]
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
Depends on the code, sometimes I am intending to do something a bit odd.
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
In my own code, I like to clean them all up. When compiling packaged software, say the latest version of gcc, I just do the configure/make/make install and ignore the warnings. ISTR a story about the linux kernel, long ago, where some helpful individual went through the code and cleaned up all the warnings. Which was great, until you tried to compile it for something other than an X86 - in which case either the build failed or the kernel broke. :doh:
-
Visual Studio:
Quote:
warning CS0168: The variable '_ex' is declared but never used
Everybody else: The F! Me: ... So what, i need the Exception message!
if(!string.IsNullOrWhiteSpace(_signature))
{
MessageBox.Show("This is my signature: " + Environment.NewLine + _signature);
}
else
{
MessageBox.Show("404-Signature not found");
}This issue came up elsewhere in the Lounge[^] a couple of weeks or so ago and the response referred to using the
$exception
variable in Watch, without the need to define an exception in thecatch
statement: StackOverflow[^] -
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
Latest Article - A 4-Stack rPI Cluster with WiFi-Ethernet Bridging Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
I'm very OCD about warnings and even add checking for a dozen more obscure ones. I then pass my code through various analyzers. Many times, seemingly trivial warnings exposed more serious logical errors.
-
How seriously do you handle them?
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
-
warnings from the compiler only proves to me the compiler doesn't understand my code.
Message Signature (Click to edit ->)
-
In my own code, I like to clean them all up. When compiling packaged software, say the latest version of gcc, I just do the configure/make/make install and ignore the warnings. ISTR a story about the linux kernel, long ago, where some helpful individual went through the code and cleaned up all the warnings. Which was great, until you tried to compile it for something other than an X86 - in which case either the build failed or the kernel broke. :doh:
Quote:
ISTR a story about the linux kernel, long ago, where some helpful individual went through the code and cleaned up all the warnings. Which was great, until you tried to compile it for something other than an X86 - in which case either the build failed or the kernel broke
It was already broken.
-
2 pints of lager, and a packet of crisps, please.[^]
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
A classic ! :-\
-
I used to go through the code and clean those out but then I decided life was too short. When I did Delphi I would sometimes get a variable not initialized warning but when I initialized it I would get a value assigned but never used warning if the variable was in a try..except block.
Would you still prefer Delphi over .Net ?