Article View: borland.public.cppbuilder.nativeapi
Article #712Re: ensuring CriticalSections are release..
From: Clayton Arends
Date: Tue, 15 Jan 2008 07:01
Date: Tue, 15 Jan 2008 07:01
24 lines
2508 bytes
2508 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:478c17ad$2@newsgroups.borland.com... > "Bob Gonder" <notbg@notmindspring.invalid> wrote in message > news:e45oo3tf9dfrtlm8udetauha7jp5s4glam@4ax.com... >> If the creation is a function, then that >> negates the uselessness test. > > Not sure what you are getting at here, Bob. I think the uselessness test applies even if the class was created without a function. The nature of classes is that they can do anything on construction and anything on destruction. This simple fact means that the compiler cannot reliably know if the variable has no practical use. When the compiler checks for use of native types such as int, float, or char it knows that if the variable is never used then it can display a warning to the user. However, with classes the compiler doesn't really know anything. The unused variable could have some real use (like RAII classes) or it could be a useless variable (like the many string classes, TDateTime, etc). Because of this I think the only logical choice a programmer has is to disable the warning (globally or where needed). Clayton
Technical Details
Message-ID:
<478c5a53$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<478a96e3@newsgroups.borland.com> <478b0076$1@newsgroups.borland.com> <478bac9a$1@newsgroups.borland.com> <478bba5f$1@newsgroups.borland.com> <478be3e4$1@newsgroups.borland.com> <478bf841$1@newsgroups.borland.com> <478c08c8$1@newsgroups.borland.com> <e45oo3tf9dfrtlm8udetauha7jp5s4glam@4ax.com> <478c17ad$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,266d339b0fd4ba38 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Clayton Arends" <nospam_claytonarends@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <478a96e3@newsgroups.borland.com> <478b0076$1@newsgroups.borland.com> <478bac9a$1@newsgroups.borland.com> <478bba5f$1@newsgroups.borland.com> <478be3e4$1@newsgroups.borland.com> <478bf841$1@newsgroups.borland.com> <478c08c8$1@newsgroups.borland.com> <e45oo3tf9dfrtlm8udetauha7jp5s4glam@4ax.com> <478c17ad$2@newsgroups.borland.com> In-Reply-To: <478c17ad$2@newsgroups.borland.com> Subject: Re: ensuring CriticalSections are release.. Date: Mon, 14 Jan 2008 23:01:21 -0800 Lines: 25 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 NNTP-Posting-Host: 68.113.27.46 Message-ID: <478c5a53$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1200380499 68.113.27.46 (14 Jan 2008 23:01:39 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail