Re: suppress 'variable is declared but never used' for exception variables?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/18/04
- Next message: Rekkie: "Events disappear in VS.Net 2003"
- Previous message: MyNews: "Re: The times should display in logged-in user desktop time zone"
- In reply to: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Next in thread: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Reply: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Jun 2004 07:54:36 +0100
mikeb <mailbox.google@nospam.mailnull.com> wrote:
> > Is there a way to suppress this for individual cases - or failing that,
> > globally?
>
> public class Unreferenced {
> [System.Diagnostics.Conditional( "DEBUG")]
> static public void Parameter( params object [] o)
> {
> return;
> }
> }
>
> // ...
>
> try {
> //
> }
> catch (Exception WebExcp) {
> Unreferenced.Parameter( WebExcp);
> return;
> }
While this will work, it would be better just to not declare WebExcp at
all:
catch (Exception)
{
...
}
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Rekkie: "Events disappear in VS.Net 2003"
- Previous message: MyNews: "Re: The times should display in logged-in user desktop time zone"
- In reply to: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Next in thread: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Reply: mikeb: "Re: suppress 'variable is declared but never used' for exception variables?"
- Messages sorted by: [ date ] [ thread ]